Class zebkit.ui.date.MonthDaysGrid
extends <zebkit.ui.grid.Grid>
<zebkit.ui.date>

Shows the given month and year days. This is one of the core class that is widely used with other date UI component.

Constructor:
zebkit.ui.date.MonthDaysGrid ([date], [month], [year])

Parameters:
  • [date] <Date>

    year to specify month and year to be shown

  • [month] <Integer>

    a month to be shown

  • [year] <Integer>

    an year to be shown




Inherited methods:
$getPosMarker( )    $initialCellX( )    $initialCellY( )    $setConstraints(c)    add(constr, d)    byConstraints([p], c)    byPath(path, [cb])    calcPreferredSize(target)    catchScrolled(psx, psy)    cellByLocation(x, y)    clearSelect( )    doLayout( )    fire(name, [path], [params])    focused( )    getBottom( )    getCanvas( )    getCellsVisibility( )    getCellView(row, col)    getColPSWidth(col)    getColWidth(col)    getColX(col)    getComponentAt(x, y)    getDataToEdit(row, col)    getGridCols( )    getGridColumns( )    getGridRows( )    getHorPadding( )    getLeft( )    getLeftCaptionWidth( )    getPreferredSize( )    getPSColWidth(col)    getPSRowHeight(row)    getRight( )    getRowHeight(row)    getRowPSHeight(col)    getTop( )    getTopCaptionHeight( )    getVerPadding( )    getXOrigin( )    getYOrigin( )    hasFocus( )    indexOf(c)    insert(i, constr, d)    invalidate( )    invalidateLayout( )    isSelected(row, col)    keyPressed(e)    keyReleased(e)    keyTyped(e)    kidAdded(index, constr, l)    kidRemoved(i, l)    laidout( )    load(JSON)    makeVisible(row, col)    off([eventName], [path], [cb])    on([eventName], [path], cb)    pageSize(d)    paintCellSelection(g, row, col, x, y)    paintComponent(g)    paintData(g)    paintNet(g)    paintPosMarker(g)    paintViewAt(g, ax, ay, v)    posChanged(target, prevOffset, prevLine, prevCol)    properties([path], props)    property([path], name, value)    recalc( )    relocated(px, py)    remove(c)    removeAll( )    removeAt(i)    removeByConstraints(ctr)    removeMe([after])    repaint([x], [y], [w], [h])    repaintCells(r1, c1, [r2], [c2])    repaintCols(c1, c2)    repaintRows(r1, r2)    replaceMe([ctr], c)    requestFocus( )    requestFocusIn([timeout])    resized(pw, ph)    select(row, [col], [b])    setAt(i, d)    setBackground(v)    setBorder([v])    setBorderLayout([gap])    setBottomPadding(bottom)    setBounds(x, y, w, h)    setByConstraints(constr, c)    setCellPadding(p)    setCellPaddings(t, l, b, r)    setColsWidth([col], [len], w)    setColWidth(column, w)    setConstraints(ctr)    setDefCellAlignments(ax, ay)    setDefCellXAlignment(ax)    setDefCellYAlignment(ay)    setDrawCaptionLines(b)    setDrawLines(hor, ver)    setEditedData(row, col, an)    setEditorProvider(p)    setEnabled(b)    setFlowLayout([ax], [ay], [dir], [gap])    setId(id)    setKids(a)    setLayout(m)    setLeftCaption(title)    setLeftPadding(left)    setLineColor(c)    setLineSize(s)    setListLayout([ax], [gap])    setLocation(xx, yy)    setModel(d)    setNavigationMode(mode)    setPadding(v)    setParent(o)    setPosition(p)    setPreferredSize(w, h)    setProperties([path], props)    setRasterLayout([usePsSize])    setRightPadding(right)    setRowHeight(row, h)    setRowsHeight([row], [len], h)    setSelectMode(mode)    setSize(w, h)    setStackLayout([gap])    setTopCaption(title)    setTopPadding(top)    setUsePsMetric(b)    setViewProvider(p)    setViews(a)    setVisible(b)    startEditing(row, col)    stopEditing(applyData)    toBack( )    toFront( )    toPreferredHeight( )    toPreferredSize( )    toPreferredWidth( )    toView(target)    validate( )    validateMetric( )    vrp( )   


public chainable addTagsDecoration (tags)

Add visual properties for the given tags set


Parameters:
public <Boolean> canMonthBeShown (month, year)

Test if the given month can be shown


Parameters:
  • month <Integer>

    a month

  • year <Integer>

    a year


Returns: <Boolean>

true if the month can be shown

protected void dateSelected (item, b)

Day selected callback function.


Parameters:
  • item <zebkit.ui.date.MonthDaysGrid.Daypan>

    a day panel

  • b <Boolean>

    a selection cell state

public <Boolean> hasMonthShown ( )

Test if the month days have a month shown.


Returns: <Boolean>

true if a month is shown

public <Boolean> isDaySelectable (item)

Test if the given day is selectable


Parameters:
  • item <zebkit.ui.date.DayPan>

    a day panel


Returns: <Boolean>

true if the given day is selectable

public chainable retagModel ( )

Re-tag the grid model. The process assign the following tags to grid model items:

  • "prevMonth" - for model item that belong to previous month of the year
  • "nextMonth" - for model item that belong to the next month of the year
  • "notSelectable" - for model items that cannot be selected
  • "today" - for model item that matches current date
public chainable selectDate (day, month, year)

Select the specified date and show appropriate month of selected date year.


Parameters:
  • day <Integer>

    a day

  • month <Integer>

    a month

  • year <Integer>

    an year

public chainable setCurrentMonthToShow ( )

Set the current date month shown.

public chainable setDateRange (min, max)

Set date range possible for selection


Parameters:
  • min <Date>

    a minimal possible selection date or null

  • max <Date>

    a maximal possible selection date or null

public chainable setMaxDate (date)

Set maximal possible selection date


Parameters:
  • date <Date>

    a maximal possible selection date or null

public chainable setMinDate (date)

Set minimal possible selection date


Parameters:
  • date <Date>

    a minimal possible selection date or null

public chainable setMonthToShow ([date], [month], [year])

Set a month and an year with the given arguments. If no parameters have been passed the current date year and month will be set.


Parameters:
  • [date] <Date>

    a date object.

  • [month] <Integer>

    a month.

  • [year] <Integer>

    a full year.

public chainable setNextMonthToShow ( )

Set the next date month to show

public chainable setNextYearToShow ( )

Set the previous year with the current month to show.

public chainable setNextYearToShow ( )

Set the next year with the current month to show.

public chainable setPrevMonthToShow ( )

Set the previous date month to show.

public chainable setSelectedToShow ( )

Set the next year with the current month to show.

public chainable setTagDecoration (tag, p)

Set decoration for the given tag.


Parameters:
public chainable setTagger (tagger)

Set days tagger function.


Parameters:
public chainable setTagsDecoration (tags)

Set the visual properties for the tags.


Parameters:
  • tags <Object>

    set visual properties for the given tags


Example:
//  render previous month day with gray color
//  and next month with light gray color
daysGrid.setTagsDecoration({
    "prevMonth" : {
        "color" : "lightGray"
     },

     "nextMonth" : {
         "color" : "lightGray"
     }
 });


Inherited attributes:
public zebkit.draw.View bg    public zebkit.draw.View border    public Boolean canHaveFocus    public Integer cellInsetsBottom    public Integer cellInsetsLeft    public Integer cellInsetsRight    public Integer cellInsetsTop    protected Array colWidths    public Object constraints    public String defXAlignment    public String defYAlignment    public Boolean drawCaptionLines    public Boolean drawHorLines    public Boolean drawVerLines    public Integer editingCol    public Integer editingRow    public zebkit.ui.Panel editor    public zebkit.ui.grid.DefEditors editors    public Integer height    public Boolean isEnabled    public Boolean isUsePsMetric    public Boolean isValid    public Boolean isVisible    public Array kids    public zebkit.layout.Layout layout    public zebkit.ui.grid.GridCaption | zebkit.ui.grid.CompGridCaption leftCaption    public String lineColor    public Integer lineSize    public zebkit.data.Matrix model    public String navigationMode    public Boolean paintPosMarkerOver    public zebkit.layout.Layoutable parent    public zebkit.util.Position position    protected Array rowHeights    protected zebkit.ui.ScrollManager scrollManager    public zebkit.ui.grid.SelectMode selectMode    public zebkit.ui.grid.GridCaption | zebkit.ui.grid.CompGridCaption topCaption    public Integer width    public Integer x    public Integer y   



public <Date> maxDate

Maximum possible selection date

public <Date> minDate

Minimum possible selection date

public <Integer> month

Shown month

public <Function> tagger

Custom tagger. The attribute is function that is called to tag the given day panel item.

public <Integer> year

Shown month year




dateSelected

Fire when the given date has been selected

  monthDays.on("dateSelected", function(src, item, b) {
      ...
  });

Parameters:
monthShown

Fire when the specified month of the given year has been shown with the component

  monthDays.on("monthShown", function(src, prevMonth, prevYear) {
      ...
  });

Parameters:
  • src <zebkit.ui.date.MonthDaysGrid>

    a source of the event

  • prevMonth <Integer>

    a previous shown month

  • prevYear <Integer>

    a previous shown year