Grid Reference

Config

allowFreezeallowGroupallowHideclickStartEdit
containercustomHeaddatasetdefaultRecord
heightidjsonParamNamelanguage
lightOverRowloadURLminHeightminWidth
pageSizepageSizeListreloadAfterSaveremoteFilter
remotePagingremoteSortreplaceContainersaveURL
selectRowByCheckshowGridMenushowIndexColumnskin
stripeRowssubmitUpdatedFieldstoolbarContenttoolbarPosition
transparentMaskwidth

allowFreeze

Boolean   To specify whether [freeze columns] item appear on main menu.

allowGroup

Boolean   To specify whether [group column] item appear on main menu.

allowHide

Boolean   To specify whether [hide column] item appear on main menu.

clickStartEdit

Boolean   To specify whether cell becomes editable once it is clicked. If this flag set to false, user need to click once more to edit an active cell.

container

Sting or DOM   Id or DOM object which grid is built up based on. Generally, container should be div or span.

customHead

String or DOM   Id, dom object or HTML code of a table, which defines layout of grid header.

dataset

Object   Dataset object of grid. Read only. See Sigma.Dataset

defaultRecord

Object or Array   Data record template. This template will be adopted if a new row is added or appended.

height

String or Number   Height of whole grid. Pixel and percentage are supported.

id

String   Id of grid. Every grid should have unique id if more than one grid appear on same page.

jsonParamName

String   To specify parameter name submitted to server side. It's set to "_gt_json" by default. For example, PHP developer could get whole JSON string by $_POST["_gt_json"] in php.

language

String   Language option. By default, messages on toolbar, on menu, of warning are in english.
These words for presentation are defined in a language file named gt_msg_en.js.
Developer can work out profile of other language. Take Spaish for example, developer need two steps.
1. Work out language file named gt_msg_sp.js and put into the directory where gt_msg_en.js is.
2. Specify language of grid to be sp.

lightOverRow

Boolean   To specify whether to hightlight one row when mouse is hovering over it.

loadURL

String   Url which grid data is loaded from. A function could not be assigned to loadURL since version 2.1, please assign records to grid by setConent. See Sigma.Grid.setContent Sample - To assign a real url to loadURL. loadURL:"http://localhost/server/getStudentsInfo.php"

minHeight

Number   To specify minimum height if grid can be resized by end user.

minWidth

Number   To specify minimum width if grid can be resized by end user.

pageSize

Number   To specify how many rows presented per page.

pageSizeList

Array   To specify page size options. See Sigma.Grid.pageSize The following sample will show a dropdown list of page size for end user to choose.

reloadAfterSave

Boolean   To specify whether grid data is reloaded after data being saving.

remoteFilter

Boolean   To specify whether server side does filtering work.

remotePaging

Boolean   To specify whether server side does paging work.

remoteSort

Boolean   To specify whether server side does sorting work.

replaceContainer

Boolean   To specify whether container is placed with grid. If not, grid will be a child of container.

saveURL

String   Url which grid data is saved to.

selectRowByCheck

Boolean   To specify whether end user can select row by checkbox.

showGridMenu

Boolean   To specify whether main menu shows up.

showIndexColumn

Boolean   To specify whether to show row number at front of every row.

skin

String   Name of skin. Could be "pink", "default", "mac", "vista". Developer can also made own skin and put in /grid/skin.

stripeRows

Boolean   To specify whether to show rows in stripe.

submitUpdatedFields

Boolean   To specify whether only modified fields are submitted to server.

toolbarContent

String   It's set to 'nav | pagesize | reload | add del save | print | filter chart | state' by default. Developer can change its order or hide some buttons. Sample To show add, delete, save buttons only. There would be a seperator between delete and save. toolbarContent : "add del | save"

toolbarPosition

String   Position of toolbar, could be "top", "bottom" or null.

transparentMask

Boolean   To spcify whether mask is transparent or not. False by default.

width

Number or String   Width of whole grid. Pixel and percentage are supported. Sample width:500 width:'100%'

Properties

activeCellactiveColumnactiveRecordactiveRow
allowCustomSkinallowFreezeallowGroupallowHide
clickStartEditcolumnMapcolumnsdefaultRecord
lightOverRowloadURLminHeightminWidth
reloadAfterSaveremoteFilterremotePagingremoteSort
resizablesaveURLselectedRowsselectRowByCheck
submitUpdatedFieldstransparentMask

activeCell

Object   Dom object of current active cell. Read only.

activeColumn

Object   Column object. Object of active/last active column. Read only.

activeRecord

Object   Data set of current active row. Read only.

activeRow

Object   Td DOM object of active/last active row. Read only.

allowCustomSkin

Boolean   To specify whether skin item appear on main menu.

allowFreeze

Boolean   To specify whether [freeze columns] item appear on main menu.

allowGroup

Boolean   To specify whether [group column] item appear on main menu.

allowHide

Boolean   To specify whether [hide column] item appear on main menu.

clickStartEdit

Boolean   To specify whether cell becomes editable once it is clicked. If this flag set to false, user need to click once more to edit an active cell.

columnMap

Object   Object of column objects in in key-value formate, where key is column id and value is column object. Read only.

columns

Array   Array of all the column objects. Read only. See Sigma.Column

defaultRecord

Object or Array   Data record template. This template will be adopted if a new row is added or appended.

lightOverRow

Boolean   To specify whether to hightlight one row when mouse is hovering over it.

loadURL

String   Url which grid data is loaded from. A function could not be assigned to loadURL since version 2.1, please assign records to grid by setConent. See Sigma.Grid.setContent Sample - To assign a real url to loadURL. loadURL:"http://localhost/server/getStudentsInfo.php"

minHeight

Number   To specify minimum height if grid can be resized by end user.

minWidth

Number   To specify minimum width if grid can be resized by end user.

reloadAfterSave

Boolean   To specify whether grid data is reloaded after data being saving.

remoteFilter

Boolean   To specify whether server side does filtering work.

remotePaging

Boolean   To specify whether server side does paging work.

remoteSort

Boolean   To specify whether server side does sorting work.

resizable

Boolean   To specify grid be resized by end user. If this flage to be set true, a resizing handle will appears at right-bottom corner. End user could resize grid by dragging this handle.

saveURL

String   Url which grid data is saved to.

selectedRows

Array   Array of selected row objects. Read only.

selectRowByCheck

Boolean   To specify whether end user can select row by checkbox.

submitUpdatedFields

Boolean   To specify whether only modified fields are submitted to server.

transparentMask

Boolean   To spcify whether mask is transparent or not. False by default.

Method

addParametersaddRowapplyFiltercheckRow
cleanContentcleanParameterscloseGridMenudeleteRow
editCellendEditexportGridfocusCell
forEachRowgetCellgetCellValuegetColumn
getDeletedRecordsgetDimensiongetDisplayColumnsgetEventTargets
getFilterInfogetInsertedRecordsgetPageInfogetRecord
getSelectedRecordsgetSkingetUpdatedRecordsgotoPage
hideCellToolTiphideDialoghideMaskhideWaiting
insertmoveColumnprintGridrefresh
refreshRowreloadrendersave
selectRowsetCellValuesetContentsetDimension
setFilterInfosetPageInfosetSkinshowCellToolTip
showDialogshowMaskshowWaitingsortGrid

addParameters(key,  value)

To add an additional parameter pair for submittal. By default, only data defined here will be submitted to server side. By this function, developers could add more parameter pairs.

Stringkey Parameter key.
Stringvalue Parameter value.

addRow(record,  startEdit)

To append a new row.

Objectrecord Data of the row to be added.
BooleanstartEdit Indicate if open the first cell for input.

applyFilter(filterInfo)

Apply filter to this grid. Only records meeting filter criteria will be displayed within grid.

ObjectfilterInfo. Filter criteria.

checkRow(row,  checked)

To check/uncheck row.

Objectrow Row to be checked/unchecked.
Booleanchecked True for checked, false for unchecked.

cleanContent()

To clear all the data showed and make grid empty.

cleanParameters()

Remove all additional parameters. See Sigma.Grid.addParameters

closeGridMenu()

To Close main menu.

deleteRow(row)

To remove row.

Objectrow DOM TR presenting a row.

editCell(cell)

To open a cell for editing.

Objectcell. Dom(td) of the cell to be open.

endEdit()

To close current cell editor and update current cell value.

exportGrid(type,  fileName,  url,  name,  action)

To export grid to a file. This function need server side programming supported.

Objecttype. Export file type. Could be "xls" for MS Excel file, "pdf" for Adobe PDF file, "csv" for
StringfileName File name.
Stringurl Url specified to export data.
Stringname Json name. Server side can get all the stuff by $_POST[name].
Stringaction Reserved.

focusCell(cell)

To focus a cell.

Objectcell. Dom(td) of the cell to be focused.

forEachRow(fn)

Excute function fn(row,record,i,grid) on each row.

Functionfn Function to be executed. It takes the following parameters. row: The object of the row. record: The data record behine the row. i: Loop counter. grid: Grid object.

getCell(rowNo,  colIdxOrId)

To get td object via row index and col index/id.

Return Object - cell Tr(DOM) of a cell.

NumberrowNo Row index.
Number or StringcolIdxOrId Column index.

getCellValue(colNoIdTd,  recordOrRowNo)

Get cell value by specifying column id and row number.

Return Any - New cell value.

StringcolNoIdTd Id of column where cell is in.
NumberrecordOrRowNo Number of row where cell is at.

getColumn(colNoIdTd)

Get column object by column id or DOM object of cell.

Return Object - Column object

ObjectcolNoIdTd Column id or DOM object of cell.

getDeletedRecords()

To get all records deleted.

Return Array - Array of records.

getDimension()

To get grid width and height.

Return Object - obj.width and obj.height

getDisplayColumns(display)

To get columns displayed or invisible.

Return Array - Column array. See Sigma.Column

Booleandisplay visible or invisible.

getEventTargets(event,  el)

To get event relevant info.

Return Object - event relevant info

Objectevent Sigma.Grid.Event object. See Sigma.Grid.Event
Objectel Sigma.Grid.EventTarget object. See Sigma.Grid.EventTarget

getFilterInfo()

Get filter criteria info

getInsertedRecords()

To get all records deleted.

Return Array - Array of records.

getPageInfo(refresh)

To get pagging info.

Objectrefresh Indecate to refresh navigator tool bar or not. Return pagging info.

getRecord(rowNoTdTr)

Get record by row number or DOM of td or tr.

Return Object - Record object.

ObjectrowNoTdTr Row number or DOM of td or tr.

getSelectedRecords()

To get selected records.

Return Array - Array of array/object. Records of selected rows.

getSkin()

To get skin name

Return String - skin Skin name. Could be 'default', 'mac', 'vista' and 'pink' or self defined name.

getUpdatedRecords()

To get all records updated.

Return Array - Array of records.

gotoPage(pageIdx)

To go to page pageIdx

NumberpageIdx Page index.

hideCellToolTip()

To hide tool tip for cell.

hideDialog()

To hide current active dialog.

hideMask()

To hide mask.

hideWaiting()

To hide a waiting bar.

insert(record,  startEdit)

To insert a row into grid.

Arrayrecord Array of array/object. Data of row to be inserted. defaultRecord will be adopted if this parameter is null. See Sigma.Grid.defaultRecord
BooleanstartEdit To set true to start to edit row right after inserting.

moveColumn(oldIndex,  newIndex,  ifreeze)

To move column oldIndex to new Index.

NumberoldIndex Index of column to be moved.
NumbernewIndex Index of new position.
Booleanifreeze Whether to freeze it.

printGrid()

To print grid. This function will popup a printer-choosing dialog box.

refresh(data)

To rebuild grid without data reloaded.

Objectdata New content data.

refreshRow(row,  record)

To refresh /update row.

Objectrow Row Object.
Array or Objectrecord New record for update row. If not specified, just refresh the row.

reload(recount,  force)

To reload data from server side.

Booleanrecount Whether recount record number.
Booleanforce Flase for refresh only.

render(container)

To render a grid.

Objectcontainer The parent div or something

save(onNav)

To save modifications to server side.

ObjectonNav Whether pop up alter if nothing changed.

selectRow(row,  selected)

To remove row.

Objectrow DOM TR presenting a row.
Booleanselected True for seleted, false for unselected.

setCellValue(colID,  recordOrRowNo,  newValue)

Set cell value by specifying column id and row number.

StringcolID Id of column where cell is in.
NumberrecordOrRowNo Number of row where cell is at.
ObjectnewValue New cell value.

setContent(respD)

To set grid data.

ArrayrespD Array of array/object. Data records.

setDimension(newWidth,  newHeight,  isInit)

To set grid width and height.

NumbernewWidth New width.
NumbernewHeight New height.
BooleanisInit Indicate whether grid is initialized.

setFilterInfo(fi)

To set filter info.

Objectfi Filter info object.

setPageInfo(pageInfo)

To update pagingo info.

ObjectpageInfo Page info object.

setSkin(skin)

To change skin by name

Stringskin Skin name. Could be 'default', 'mac', 'vista' and 'pink'.

showCellToolTip(cell,  width)

To show tool tip for cell.

Objectcell On which cell tip will show.
Objectwidth Tip balloon width.

showDialog(type)

To show a dialog.

Stringtype Could be 'filter' or 'chart'.

showMask(trp)

To show/hide a mask.

Booleantrp True for show, false for hide.

showWaiting()

To show a waiting bar.

sortGrid(sortInfo)

To sort grid by specifed rules.

ArraysortInfo. Array of sortInfo.

Events

afterColumnResizeafterEditafterRowSelectbeforeColumnMove
beforeDeletebeforeEditbeforeExportbeforeInsert
beforeLoadbeforeRowSelectbeforeSavebeforeUpdate
customRowAttributeexportFailureloadFailureloadResponseHandler
onCellClickonCellDblClickonCompleteonContextMenu
onHeadClickonKeyDownonMouseMoveonMouseOut
onMouseOveronResizeonRowCheckonRowClick
onRowDblClicksaveFailuresaveResponseHandler

afterColumnResize(  colObj,  newWidth,  grid)

Fired after one column is resized.

ObjectcolObj Column object resized.
NumbernewWidth Column new width.
Objectgrid Grid of the column resized.

afterEdit(  value,  oldValue,  record,  col,  grid)

Fired before cell is closed after editing.

Anyvalue New value of the cell.
AnyoldValue Old value of the cell.
Object or arrayrecord Data record of the row.
Objectcol Column object.
Objectgrid Grid object.

afterRowSelect(  value,  record,  cell,  row,  colNo,  columnObj,  grid)

Fired after end user selects one row.

Anyvalue Value of the cell where mouse pointer is at.
Object or arrayrecord Data record of the row to be selected.
Objectcell Dom of the cell where mouse pointer is at.
Objectrow Dom(tr) of row to be selected.
NumbercolNo Index of the column where mouse pointer is at. Base on 0.
ObjectcolumnObj Column object.
Objectgrid Grid of the column resized.

beforeColumnMove(  oldIndex,  newIndex)

Fired before column being moved.

Return Boolean - Return false to prevent column from being moved.

NumberoldIndex Index of column to be moved.
NumbernewIndex Index of new position.

beforeDelete(  Data,  row,  grid)

Fired before an existing row is to be removed from grid.

Return Boolean - Return false to prevent row from being removed.

Record or ObjectData record behind the row.
Objectrow Dom(td) of row to be remove.
Objectgrid Grid object.

beforeEdit(  value,  record,  col,  grid)

Fired before cell is open for editing.

Return Boolean - Return false to prevent cell being open for editing.

Anyvalue Value of the cell to be open for editing.
Object or arrayrecord Data record of the row.
Objectcol Column object.
Objectgrid Grid Object.

beforeExport(  type,  fileName,  url,  name,  action,  fileName)

Fired before Data is sent to server side for exporting.

Return Boolean - Return false to prevent data from being exported.

Stringtype File type, could be xml/pdf/csv/xls.
StringfileName File name.
Stringurl Url specified to export data.
Stringname Json name. Server side can get all the stuff by $_POST[name].
Stringaction Reserved.
StringfileName File name.

beforeInsert(  Data)

Fired before a new row is to be added to the grid.

Return Boolean - Return false to prevent row from being added.

Record or ObjectData record behind the row.

beforeLoad(  requestParameter)

Fired before grid is to about to load data from server side.

Return Boolean - Return false to prevent grid from loading data from server side.

ObjectrequestParameter See DataExchange.Loading.

beforeRowSelect(  record,  row,  rowNo,  grid)

Fired before end user selects one row.

Return Boolean - Return false to prevent row from being selected.

Object or arrayrecord Data record of the row to be selected.
Objectrow Dom(tr) of row to be selected.
NumberrowNo Index of the row where mouse pointer is at. Base on 0..
Objectgrid Grid of the column resized.

beforeSave(  requestParameter)

Fired before changed data is to be posted to server side.

Return Boolean - Return false to prevent data from being posted to server side.

ObjectrequestParameter See DataExchange.Saving.

beforeUpdate(  Data,  fieldName,  newValue)

Fired before one record will be updated with a new value.

Return Boolean - Return false to prevent record to be updated.

Record or ObjectData record to be updated.
StringfieldName Name of field to be updated.
AnynewValue New value of the cell updated.

customRowAttribute(  record,  rowNo,  grid)

Fired when row style is to specified.

Return String - Css style string. For example : "background-color:red;"

Object or arrayrecord Data record of the row where the cell is at.
NumberrowNo Index of the row.
Objectgrid Grid object.

exportFailure(  respD,  respD,  e)

Fired when failing to export data to xml/excel/pdf etc. The following is a default implementaion.

StringrespD.exception record to be updated.
BooleanrespD.success Name of field to be updated.
Stringe.message Error message description.

loadFailure(  respD,  respD,  e)

Fired when failing to load data from server. The following is a default implementaion.

StringrespD.exception record to be updated.
BooleanrespD.success Name of field to be updated.
Stringe.message Error message description.

loadResponseHandler(  response,  requestParameter)

This function is a call back function to deal with the received content from server side. Developer could do some data translation work within this function.

Stringresponse Response plain text content.
ObjectrequestParameter See DataExchange.Loading.

onCellClick(  value,  record,  cell,  row,  colNo,  columnObj,  grid)

Fired when end user click one cell.

Return Boolean - Return false to prevent default behavior.

Anyvalue Value of the cell where mouse pointer is at.
Object or arrayrecord Data record of the row where the cell is at.
Objectcell Dom(td) of the cell.
Objectrow Dom of row where the cell is at.
NumbercolNo Index of the column where the cell is at.
ObjectcolumnObj Column object.
Objectgrid Grid of the cell clicked on.

onCellDblClick(  value,  record,  cell,  row,  colNo,  columnObj,  grid)

Fired when end user double click on one cell.

Return Boolean - Return false to prevent default behavior.

Anyvalue Value of the cell where mouse pointer is at.
Object or arrayrecord Data record of the row where the cell is at.
Objectcell Dom(td) of the cell.
Objectrow Dom of row where the cell is at.
NumbercolNo Index of the column where the cell is at.
ObjectcolumnObj Column object.
Objectgrid Grid of the cell clicked on.

onComplete(  grid)

Fired when grid is completely loaded. Refresh/sort/paging will also fire this event

Objectgrid Grid of the column resized.

onContextMenu(  value,  record,  cell,  row,  colNo,  rowNo,  columnObj,  grid)

Fired when end user double click on one cell.

Return Boolean - Return false to prevent default behavior.

Anyvalue Value of the cell where mouse pointer is at.
Object or arrayrecord Data record of the row where the cell is at.
Objectcell Dom(td) of the cell.
Objectrow Dom of row where the cell is at.
NumbercolNo Index of the column where the cell is at.
NumberrowNo Index of the row where the cell is at.
ObjectcolumnObj Column object.
Objectgrid Grid of the cell clicked on.

onHeadClick(  event,  headCell,  colObj,  grid)

Fired when end user click column header.

Return Boolean - Return false to prevent default behavior.

Objectevent See Sigma.Grid.Event.
ObjectheadCell Dom of the head cell.
ObjectcolObj Column object.
Objectgrid Grid of the header clicked on.

onKeyDown(  event)

Fired when end user press a key down.

Return Boolean - Return false to prevent grid default behavior.

Objectevent Browser raw event object.

onMouseMove(  value,  record,  cell,  row,  colNo,  rowNo,  columnObj,  grid)

Fired when mouse pointer is moving over grid.

Anyvalue Value of the cell where mouse pointer is at.
Object or arrayrecord Data record of the row where mouse pointer is at.
Objectcell Dom(td) of the cell.
Objectrow Dom of row where mouse pointer is at.
NumbercolNo Index of the column where mouse pointer is at.
NumberrowNo Index of the row where mouse pointer is at.
ObjectcolumnObj Column object.
Objectgrid Grid object.

onMouseOut(  value,  record,  cell,  row,  colNo,  rowNo,  columnObj,  grid)

Fired when mouse pointer is to be out of grid.

Anyvalue Value of the cell where mouse pointer is at.
Object or arrayrecord Data record of the row where mouse pointer is at.
Objectcell Dom(td) of the cell.
Objectrow Dom of row where mouse pointer is at.
NumbercolNo Index of the column where mouse pointer is at.
NumberrowNo Index of the row where mouse pointer is at.
ObjectcolumnObj Column object.
Objectgrid Grid object.

onMouseOver(  value,  record,  cell,  row,  colNo,  columnObj,  grid)

Fired when mouse pointer is over grid.

Anyvalue Value of the cell where mouse pointer is at.
Object or arrayrecord Data record of the row where mouse pointer is at.
Objectcell Dom(td) of the cell.
Objectrow Dom of row where mouse pointer is at.
NumbercolNo Index of the column where mouse pointer is at.
ObjectcolumnObj Column object.
Objectgrid Grid object.

onResize()

Fired when width or height of grid changes.

onRowCheck(  row,  chk,  grid)

Fired when one row is to be checked or unchecked.

Objectrow Dom of row where mouse pointer is at.
Booleanchk If row is to be checked or unchecked.
Objectgrid Grid object.

onRowClick(  value,  record,  cell,  row,  colNo,  columnObj,  grid)

Fired when end user double click on one row.

Return Boolean - Return false to prevent default behavior.

Anyvalue Value of the cell where mouse pointer is at.
Object or arrayrecord Data record of the row.
Objectcell Dom(td) of the cell where mouse pointer is at.
Objectrow Dom of the row .
NumbercolNo Index of the column where mouse pointer is at.
ObjectcolumnObj Column object.
Objectgrid Grid of the row clicked on.

onRowDblClick(  value,  record,  cell,  row,  colNo,  columnObj,  grid)

Fired when end user double click on one row.

Return Boolean - Return false to prevent default behavior.

Anyvalue Value of the cell where mouse pointer is at.
Object or arrayrecord Data record of the row.
Objectcell Dom(td) of the cell where mouse pointer is at.
Objectrow Dom of the row .
NumbercolNo Index of the column where mouse pointer is at.
ObjectcolumnObj Column object.
Objectgrid Grid of the row double clicked on.

saveFailure(  respD,  respD,  e)

Fired when failing to load data from server. The following is a default implementaion.

StringrespD.exception record to be updated.
BooleanrespD.success Name of field to be updated.
Stringe.message Error message description.

saveResponseHandler(  response,  requestParameter)

This function is a call back function to deal with the received content from server side. Developer could do some data translation work within this function.

Stringresponse Response plain text content.
ObjectrequestParameter See DataExchange.Saving.