linb.UI.TreeGrid

Direct Super Classes

linb.Base

linb.iBox

linb.iDataBinder

linb.UI

linb.UI.iList

linb.UI.iWidget

Events

afterCellActive (profile, cell)
Fired after cell is active.
profile: UIProfile. See profile name.
cell: Object. Cell whichi is active.

afterColumnMoved ( profile, fromId, toId )
Fired after column is moved.
profile: UIProfile. See profile name.
fromId: string. Id of column being dragged.
toId: string. Id of row on which column is dropped on.

afterColumnSort (profile, id, order)
Fired before grid rows are sorted by one column.
profile: UIProfile. See profile name.
id: string. Column id.
order: string. Could be "asc" or "desc".

afterCreated (profile)
Fired after component is created. At this time, component object has not been attached to DOM.
profile: UIProfile. See profile name.

afterRendered (profile)
Fired after component is rendered in DOM. At this time, component object has been attached to DOM.
profile: UIProfile. See profile name.

afterRowActive (profile, row)
Fired after row is active.
profile: UIProfile. See profile name.
row: Object. Row whichi is active.

afterRowMoved ( profile, fromId, toId )
Fired after row is moved.
profile: UIProfile. See profile name.
fromId: string. Id of row being dragged.
toId: string. Id of row on which row is dropped on.

afterValueSet (profile, oldValue, newValue, showValue)
Fired after value is set. See Sigma Linb component value model.
profile: UIProfile. See profile name.
oldValue: Boolean. Value before setting.
newValue: Boolean. Value after setting.
showValue: Boolean. Presentation value.

afterValueUpdated (profile, oldValue, newValue, showValue)
Fired after value is uppadeted. See Sigma Linb component value model.
profile: UIProfile. See profile name.
oldValue: Boolean. Value before setting.
newValue: Boolean. Value after setting.
showValue: Boolean. Presentation value.

beforeCellActive ( profile, cell )
Fired before cell is active.
profile: UIProfile. See profile name.
cell: Object. Cell whichi is to be active.

beforeClickEffect (profile, item, src, type)
When end uese is clicking this component, this component will high-light itself. This action is called clicking effect. Developer can change default effect in this event handler. If false returned, default effect will be disabled.
profile: UIProfile. See profile name.
item: Always be null.
src: DOM node. The DOM host of this event.
type: String. Could be "mousedown" or "mouseup".

beforeColumnDrag ( profile, id )
Fired before column is drag.
profile: UIProfile. See profile name.
id: string. Row id.

beforeColumnMoved ( profile, fromId, toId )
Fired before column is moved.
profile: UIProfile. See profile name.
fromId: string. Id of column being dragged.
toId: string. Id of row on which column is dropped on.

beforeColumnSort (profile, id, order)
Fired before grid rows are sorted by one column.
profile: UIProfile. See profile name.
id: string. Column id.
order: string. Could be "asc" or "desc".

beforeDestroy (profile)
Fired before component is destroyed.
profile: UIProfile. See profile name.

beforeHoverEffect (profile, item, src, type)
When mouse pointer is hovering over this component, this component will high-light itself. This action is called clicking effect. Developer can change default effect in this event handler. If false returned, default effect will be disabled.
profile: UIProfile. See profile name.
item: Always be null.
src: DOM node. The DOM host of this event.
type: String. Could be "mousedown" or "mouseup".

beforeNextFocus (profile, e, src)
Fired before next component gets focus.
profile: UIProfile. See profile name.
e: See event object.
src: DOM node. The DOM host of this event.

beforeRowActive ( profile, row)
Fired before row is active.
profile: UIProfile. See profile name.
row: Object. Row whichi is to be active.

beforeRowDrag (profile,id)
Fired before row is drag.
profile: UIProfile. See profile name.
id: string. Row id.

beforeRowMoved ( profile, fromId, toId))
Fired before row is moved.
profile: UIProfile. See profile name.
fromId: string. Id of row being dragged.
toId: string. Id of row on which row is dropped on.

beforeValueSet (profile, oldValue, newValue, showValue)
Fired before value is set. See Sigma Linb component value model.
profile: UIProfile. See profile name.
oldValue: Boolean. Value before setting.
newValue: Boolean. Value after setting.
showValue: Boolean. Presentation value.

beforeValueUpdated (profile, oldValue, newValue, showValue)
Fired before value is updated. See Sigma Linb component value model.
profile: UIProfile. See profile name.
oldValue: Boolean. Value before setting.
newValue: Boolean. Value after setting.
showValue: Boolean. Presentation value.

onDblClickRow (profile, row,e,src)
Fired when row is double clicked.
profile: UIProfile. See profile name.
row: Object. Row which is double clicked.
e: See event object.
src: DOM node. The DOM host of this event.

onHotKeydown (profile, key, control, shift, alt, e, src)
Fired when key is down.
profile: UIProfile. See profile name.
key: String. Example - "a","b","c","enter","tab".
control: Boolean. True for user pressing Ctrl key , false for not.
shift: Boolean. True for user pressing Shift key , false for not.
alt: Boolean. True for user pressing Alt key , false for not.
e: See event object.
src: DOM node. Event host.

onHotKeypress (profile, key, control, shift, alt, e, src)
Fired when key is pressed.
profile: UIProfile. See profile name.
key: String. Example - "a","b","c","enter","tab".
control: Boolean. True for user pressing Ctrl key , false for not.
shift: Boolean. True for user pressing Shift key , false for not.
alt: Boolean. True for user pressing Alt key , false for not.
e: See event object.
src: DOM node. Event host.

onHotKeyup (profile, key, control, shift, alt, e, src)
Fired when key is up.
profile: UIProfile. See profile name.
key: String. Example - "a","b","c","enter","tab".
control: Boolean. True for user pressing Ctrl key , false for not.
shift: Boolean. True for user pressing Shift key , false for not.
alt: Boolean. True for user pressing Alt key , false for not.
e: See event object.
src: DOM node. Event host.

onRequestData (profile, id, threadid)
Fired when grid is to request data from server. This is alway fired when user clicks plus in the front the row to see its sub-rows.
profile: UIProfile. See profile name.
id: Id of row.
thread id: Id of thread.

Instance Methods

getActiveMode ( )
Determine grid active mode.
returns: string. Active mode. Could be "row", "cell".

getCellDfWidth ( )
Get cell default width.
returns: integer. Cell width.

getColDragKey ( )
Get column dragging key.
returns: string. column dragging key.

getColResizer ( )
Determine whether end user could change column width by dragging column header edge.
returns: boolean. True for could, false for couldn't.

getColSortable ( )
Determine whether end user could sort rows by clicking column header.
returns: boolean. True for could, false for couldn't.

getEditable ( )
Determine whether end user could edit grid.
returns: boolean. True for could, false for couldn't.

getHeader ( )
To specify what and how grid header is consist of. See setHeader() for more.
returns: object. Object which describes what and how grid header is consist of.

getHeaderHeight ( )
Get grid header height.
returns: integer. Header height.

getMinColW ( )
Get Column minimum width.
returns: integer. Column minimum width.

getMinRowH ( )
Get row minimum height.
returns: integer. Row minimum height.

getRowDragable ( )
Determine whether end user could drag row.
returns: boolean. True for could, false for couldn't.

getRowDragKey ( )
Get row dragging key.
returns: string. Row dragging key.

getRowDragToAny ( )
Determine whether end user could drag row to other ui control.
returns: boolean. True for could, false for couldn't.

getRowHandler ( )
Determine whether row handler is visible or not.
returns: boolean. True for visible, false for invisible.

getRowHandlerWidth ( )
Get row handler width.
returns: integer. Row handler width.

getRowHeight ( )
Get Row height.
returns: integer. Row height.

getRowResizer ( )
Determine whether end user could change row height by dragging row handler edge.
returns: boolean. True for could, false for couldn't.

getRows ( )
Get rows object. See setRows() for more.
returns. object. Object which describe how rows are consist of.

insertRows ( arr, pid, base, before )
Insert rows into grid. Sample - insertRows([{id:'11',cells:['newrow1', '']},{id:'12',cells:['newrow2', '']}],'5', '6', true)
arr: row array.
pid: string. Parent row id.
base: string. Id of the row before or after which new rows are inserted.
before: boolean. True for before base, false for after base.

openRow ( id, flag )
To expand a row which has children. Nothing to be done with childless row.
id: string. Row id.

removeAllRows ( )
Remove all rows inside grid and make grid empty.

removeRows ( ids )
Remove rows. Sample - removeRows(['2','5'])
ids: string array. Id array of rows to be removed.

scrollTo ( pos )
Move vertical scroll bar to a specific position.
pos: integer. Scroll bar position.

setActiveMode ( value, flag )
Set active mode.
value: string. Active mode. Could be "row", "cell".

setCellDfWidth ( value, flag )
Set cell default width.
value: integer. Cell width.

setColDragable ( value, flag )
Specify whether end user could change column order by dragging column header.
value: boolean. True for could, false for couldn't.

setColDragKey ( value, flag )
Set column dragging key.
value: string. column dragging key.

setColResizer ( value, flag )
Specify whether end user could change column width by dragging column header edge.
value: boolean. True for could, false for couldn't.

setColSortable ( value, flag )
Specify whether end user could sort rows by clicking column header.
value: boolean. True for could, false for couldn't.

setEditable ( value, flag )
Specify whether end user could edit grid.
value: boolean. True for could, false for couldn't.

setHeader ( v )
To specify what and how grid header is consist of. Sample -
setHeader([{"id":"col1","caption":"col1","type":"input","width":50},{"id":"col2","caption":"col2","type":"input","width":80}]).
v: object. Object which describes what and how grid header is consist of.

setHeaderHeight ( value, flag )
Set grid header height.
value: integer. Header height.

setMinColW ( value, flag )
Set Column minimum width.
value: integer. Column minimum width.

setMinRowH ( value, flag )
Set Row minimum height.
value: integer. Row minimum height.

setRowDragable ( value, flag )
Specify whether end user could drag row.
value: boolean. True for could, false for couldn't.

setRowDragKey ( value, flag )
Set row dragging key.
value: string. Row dragging key.

setRowDragToAny ( value, flag )
Specify whether end user could drag row to other ui control.
value: boolean. True for could, false for couldn't.

setRowHandler ( value, flag )
Set row handler visible or not.
value: boolean. True for visible, false for invisible.

setRowHandlerWidth ( value, flag )
Specify row handler width.
value: integer. Row handler width.

setRowHeight ( value, flag )
Set Row height.
value: integer. Row height.

setRowResizer ( value, flag )
Specify whether end user could change row height by dragging row handler edge.
value: boolean. True for could, false for couldn't.

setRows ( v )
Set grid content. Sample -
setRows([{"id":"row1","cells":[{"value":"cell11"},{"value":"cell12"}],"tabindex":1},
{"id":"row2","cells":[{"value":"cell21","type":"label"},{"value":"cell22"}], "sub":[{"id":"row21","cells":[{"value":"cell31"},"value":"cell32","type":"number"}]}],"tabindex":1}])
v: object. Content object

updateCell ( cellId, value )
Update cell value.
cellId: string. Cell id.
value: object. New value.

updateCellbyRowCol ( rowId, colId, value )
Update a cell's value.
rowId: string. Id of the row where cell is at.
colId: string. Id of col where cell is at.
value: object. New value.

Static Methods