Zebra API Doc

zebra.ui.grid.DefViews Class

Default grid cell views provider. The class rules how a grid cell content, background has to be rendered and aligned. Developers can implement an own views providers and than setup it for a grid by calling "setViewProvider(...)" method.

Constructor

zebra.ui.grid.DefViews

(
  • [render]
)

Parameters:

Methods

getCellColor

(
  • target
  • row
  • col
)
String

Get the given grid cell color

Parameters:

  • target zebra.ui.grid.Grid

    a target grid component

  • row Integer

    a grid cell row

  • col Integer

    a grid cell column


Return: String

a cell color to be applied to the given grid cell

getView

(
  • target
  • row
  • col
  • obj
)
zebra.ui.View

Get a renderer to draw the specified grid model value.

Parameters:

  • target zebra.ui.grid.Grid

    a target Grid component

  • row Integer

    a grid cell row

  • col Integer

    a grid cell column

  • obj Object

    a model value for the given grid cell


Return: zebra.ui.View

an instance of zebra view to be used to paint the given cell model value

getXAlignment

(
  • target
  • row
  • col
)
Integer

Get an horizontal alignment a content in the given grid cell has to be adjusted. The method is optional.

Parameters:

  • target zebra.ui.grid.Grid

    a target grid component

  • row Integer

    a grid cell row

  • col Integer

    a grid cell column


Return: Integer

a horizontal alignment (zebra.layout.LEFT, zebra.layout.CENTER, zebra.layout.RIGHT)

getYAlignment

(
  • target
  • row
  • col
)
Integer

Get a vertical alignment a content in the given grid cell has to be adjusted. The method is optional.

Parameters:

  • target zebra.ui.grid.Grid

    a target grid component

  • row Integer

    a grid cell row

  • col Integer

    a grid cell column


Return: Integer

a vertical alignment (zebra.layout.TOP, zebra.layout.CENTER, zebra.layout.BOTTOM)

setColor

(
  • c
)

Set the default view provider text render color

Parameters:

  • c String

    a color

setFont

(
  • f
)

Set the default view provider text render font

Parameters:

Attributes

render

zebra.ui.StringRender protected readonly

Default render that is used to paint grid content.