Class zebkit.ui.grid.BaseCaption
extends <zebkit.ui.Panel>
<zebkit.ui.grid>

Grid caption base UI component class. This class has to be used as base to implement grid caption components

Constructor:
zebkit.ui.grid.BaseCaption ([titles])

Parameters:
  • [titles] <Array>

    a caption component titles




Inherited methods:
$setConstraints(c)    add(constr, d)    byConstraints([p], c)    byPath(path, [cb])    calcPreferredSize(target)    doLayout( )    fire(event, [path], [params])    focused( )    getBottom( )    getCanvas( )    getComponentAt(x, y)    getHorPadding( )    getLeft( )    getPreferredSize( )    getRight( )    getTop( )    getVerPadding( )    hasFocus( )    indexOf(c)    insert(i, constr, d)    invalidate( )    invalidateLayout( )    kidAdded(index, constr, l)    kidRemoved(i, l)    laidout( )    load(JSON)    off([eventName], [path], [cb])    on([eventName], [path], cb)    paintComponent(g)    paintViewAt(g, ax, ay, v)    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])    requestFocus( )    requestFocusIn([timeout])    resized(pw, ph)    setAt(i, d)    setBackground(v)    setBorder([v])    setBottomPadding(bottom)    setBounds(x, y, w, h)    setByConstraints(constr, c)    setConstraints(ctr)    setEnabled(b)    setId(id)    setKids(a)    setLayout(m)    setLeftPadding(left)    setLocation(xx, yy)    setPadding(v)    setParent(o)    setPreferredSize(w, h)    setProperties([path], props)    setRightPadding(right)    setSize(w, h)    setTopPadding(top)    setVisible(b)    toBack( )    toFront( )    toPreferredHeight( )    toPreferredSize( )    toPreferredWidth( )    toView(target)    validate( )    validateMetric( )    vrp( )   


public <Integer> calcRowColAt (x, y, [f])

Compute a column (for horizontal caption component) or row (for vertically aligned caption component) at the given location


Parameters:
  • x <Integer>

    a x coordinate

  • y <Integer>

    an y coordinate

  • [f] <Function>

    an optional match function. The method can be passed if you need to detect a particular area of row or column. The method gets a grid metrics as the first argument, a x or y location to be detected, a row or column y or x coordinate, a row or column height or width and row or column index. The method has to return true if the given location is in.


Returns: <Integer>

a row or column

public <Integer> getCaptionPS (rowcol)

Get the given row or column caption preferred size


Parameters:
  • rowcol <Integer>

    a row or column of a caption


Returns: <Integer>

a size of row or column caption

public void matrixResized (target, prevRows, prevCols)

Implement the method to be aware when number of rows or columns in a grid model has been updated


Parameters:
  • target <zebkit.ui.grid.Grid>

    a target grid

  • prevRows <Integer>

    a previous number of rows

  • prevCols <Integer>

    a previous number of columns

public void matrixSorted (target, sortInfo)

Implement the method to be aware when a grid model data has been re-ordered.


Parameters:
public void pointerClicked (e)

Define pointer clicked events handler.


Parameters:
public void pointerDragEnded (e)

Define pointer drag ended events handler.


Parameters:
public void pointerDragged (e)

Define pointer dragged events handler.


Parameters:
public void pointerDragStarted (e)

Define pointer drag started events handler.


Parameters:
public void pointerMoved (e)

Define pointer moved events handler.


Parameters:
public chainable setLabels ([labels])

Set the grid caption labels


Parameters:
  • [labels] <Object> (*..n)

    labels



Inherited attributes:
public zebkit.draw.View bg    public zebkit.draw.View border    public Boolean canHaveFocus    public Object constraints    public Integer height    public Boolean isEnabled    public Boolean isValid    public Boolean isVisible    public Array kids    public zebkit.layout.Layout layout    public zebkit.layout.Layoutable parent    public Integer width    public Integer x    public Integer y   



public <Integer> activeAreaSize

Size of the active area where cells size can be changed by pointer dragging event

public <Boolean> isAutoFit

Indicate if the grid cell size has to be adjusted according to the cell preferred size by pointer double click event.

public <Boolean> isResizable

Indicate if the grid cells are resize-able. to the cell preferred size by pointer double click event.

public <Integer> minSize

Minimal possible grid cell size




captionResized

Fire when a grid row selection state has been changed

caption.on("captionResized", function(caption, rowcol, phw) {
    ...
});

Parameters:
  • caption <zebkit.ui.grid.BaseCaption>

    a caption

  • rowcol <Integer>

    a row or column that has been resized

  • pwh <Integer>

    a previous row or column size