Class zebkit.ui.grid.BaseCaption
mixed with <zebkit.EventProducer>
extends <zebkit.ui.Panel>

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

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

  • [titles] <Array>

    a caption component titles

Inherited methods:
$setConstraints(c)    add(constr, d)    byConstraints([p], c)    byPath(path, [cb])    calcPreferredSize(target)    doLayout( )    fire(name, [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])    replaceMe([ctr], c)    requestFocus( )    requestFocusIn([timeout])    resized(pw, ph)    setAt(i, d)    setBackground(v)    setBorder([v])    setBorderLayout([gap])    setBottomPadding(bottom)    setBounds(x, y, w, h)    setByConstraints(constr, c)    setConstraints(ctr)    setEnabled(b)    setFlowLayout([ax], [ay], [dir], [gap])    setId(id)    setKids(a)    setLayout(m)    setLeftPadding(left)    setListLayout([ax], [gap])    setLocation(xx, yy)    setPadding(v)    setParent(o)    setPreferredSize(w, h)    setProperties([path], props)    setRasterLayout([usePsSize])    setRightPadding(right)    setSize(w, h)    setStackLayout([gap])    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

  • 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

  • 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

  • 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.

public void pointerClicked (e)

Define pointer clicked events handler.

public void pointerDragEnded (e)

Define pointer drag ended events handler.

public void pointerDragged (e)

Define pointer dragged events handler.

public void pointerDragStarted (e)

Define pointer drag started events handler.

public void pointerMoved (e)

Define pointer moved events handler.

public chainable setLabels ([labels])

Set the grid caption labels

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


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


Fire when a grid row selection state has been changed

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

  • 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