Zebra API Doc

zebra.ui.grid.BaseCaption Class

Extends zebra.ui.Panel

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

Constructor

zebra.ui.grid.BaseCaption

(
  • [titles]
)

Parameters:

  • [titles] Array optional

    a caption component titles

Methods

calcRowColAt

(
  • x
  • y
  • [f]
)
Integer

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 optional

    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.


Return: Integer

a row or column

getCaptionPS

(
  • rowcol
)
Integer

Get the given row or column caption preferred size

Parameters:

  • rowcol Integer

    a row or column of a caption


Return: Integer

a size of row or column caption

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 zebra.ui.grid.Grid

    a target grid

  • prevRows Integer

    a previous number of rows

  • prevCols Integer

    a previous number of columns

matrixSorted

(
  • target
  • sortInfo
)

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

Parameters:

mouseClicked

(
  • e
)

Define mouse clicked events handler.

Parameters:

mouseDragEnded

(
  • e
)

Define mouse drag ended events handler.

Parameters:

mouseDragged

(
  • e
)

Define mouse dragged events handler.

Parameters:

mouseDragStarted

(
  • e
)

Define mouse drag started events handler.

Parameters:

mouseMoved

(
  • e
)

Define mouse moved events handler.

Parameters:

Attributes

activeAreaSize

Number

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

Default: 5

isAutoFit

Boolean

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

Default: true

isResizable

Boolean

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

Default: true

lineColor

String

Caption line color

Default: "gray"

minSize

Number

Minimal possible grid cell size

Default: 10

Events

captionResized

Fire when a grid row selection state has been changed

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

Event Parameters:

  • caption zebra.ui.grid.BaseCaption

    a caption

  • rowcol Integer

    a row or column that has been resized

  • pwh Integer

    a a previous row or column size