Config
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
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
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.
String | key | Parameter key. |
String | value | Parameter value. |
addRow(record,  startEdit)
To append a new row.
Object | record | Data of the row to be added. |
Boolean | startEdit | 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.
Object | filterInfo | . Filter criteria. |
checkRow(row,  checked)
To check/uncheck row.
Object | row | Row to be checked/unchecked. |
Boolean | checked | 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.
Object | row | DOM TR presenting a row. |
editCell(cell)
To open a cell for editing.
Object | cell | . 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.
Object | type | . Export file type. Could be "xls" for MS Excel file, "pdf" for Adobe PDF file, "csv" for |
String | fileName | File name. |
String | url | Url specified to export data. |
String | name | Json name. Server side can get all the stuff by $_POST[name]. |
String | action | Reserved. |
focusCell(cell)
To focus a cell.
Object | cell | . Dom(td) of the cell to be focused. |
forEachRow(fn)
Excute function fn(row,record,i,grid) on each row.
Function | fn | 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.
Number | rowNo | Row index. |
Number or String | colIdxOrId | Column index. |
getCellValue(colNoIdTd,  recordOrRowNo)
Get cell value by specifying column id and row number.
Return Any - New cell value.
String | colNoIdTd | Id of column where cell is in. |
Number | recordOrRowNo | Number of row where cell is at. |
getColumn(colNoIdTd)
Get column object by column id or DOM object of cell.
Return Object - Column object
Object | colNoIdTd | 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
Boolean | display | visible or invisible. |
getEventTargets(event,  el)
To get event relevant info.
Return Object - event relevant info
Object | event | Sigma.Grid.Event object. See Sigma.Grid.Event |
Object | el | 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.
Object | refresh | 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.
Object | rowNoTdTr | 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
Number | pageIdx | 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.
Array | record | Array of array/object. Data of row to be inserted. defaultRecord will be adopted if this parameter is null. See Sigma.Grid.defaultRecord |
Boolean | startEdit | To set true to start to edit row right after inserting. |
moveColumn(oldIndex,  newIndex,  ifreeze)
To move column oldIndex to new Index.
Number | oldIndex | Index of column to be moved. |
Number | newIndex | Index of new position. |
Boolean | ifreeze | 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.
Object | data | New content data. |
refreshRow(row,  record)
To refresh /update row.
Object | row | Row Object. |
Array or Object | record | New record for update row. If not specified, just refresh the row. |
reload(recount,  force)
To reload data from server side.
Boolean | recount | Whether recount record number. |
Boolean | force | Flase for refresh only. |
render(container)
To render a grid.
Object | container | The parent div or something |
save(onNav)
To save modifications to server side.
Object | onNav | Whether pop up alter if nothing changed. |
selectRow(row,  selected)
To remove row.
Object | row | DOM TR presenting a row. |
Boolean | selected | True for seleted, false for unselected. |
setCellValue(colID,  recordOrRowNo,  newValue)
Set cell value by specifying column id and row number.
String | colID | Id of column where cell is in. |
Number | recordOrRowNo | Number of row where cell is at. |
Object | newValue | New cell value. |
setContent(respD)
To set grid data.
Array | respD | Array of array/object. Data records. |
setDimension(newWidth,  newHeight,  isInit)
To set grid width and height.
Number | newWidth | New width. |
Number | newHeight | New height. |
Boolean | isInit | Indicate whether grid is initialized. |
setFilterInfo(fi)
To set filter info.
Object | fi | Filter info object. |
setPageInfo(pageInfo)
To update pagingo info.
Object | pageInfo | Page info object. |
setSkin(skin)
To change skin by name
String | skin | Skin name. Could be 'default', 'mac', 'vista' and 'pink'. |
showCellToolTip(cell,  width)
To show tool tip for cell.
Object | cell | On which cell tip will show. |
Object | width | Tip balloon width. |
showDialog(type)
To show a dialog.
String | type | Could be 'filter' or 'chart'. |
showMask(trp)
To show/hide a mask.
Boolean | trp | True for show, false for hide. |
showWaiting()
To show a waiting bar.
sortGrid(sortInfo)
To sort grid by specifed rules.
Array | sortInfo | . Array of sortInfo. |
Events
afterColumnResize(  colObj,  newWidth,  grid)
Fired after one column is resized.
Object | colObj | Column object resized. |
Number | newWidth | Column new width. |
Object | grid | Grid of the column resized. |
afterEdit(  value,  oldValue,  record,  col,  grid)
Fired before cell is closed after editing.
Any | value | New value of the cell. |
Any | oldValue | Old value of the cell. |
Object or array | record | Data record of the row. |
Object | col | Column object. |
Object | grid | Grid object. |
afterRowSelect(  value,  record,  cell,  row,  colNo,  columnObj,  grid)
Fired after end user selects one row.
Any | value | Value of the cell where mouse pointer is at. |
Object or array | record | Data record of the row to be selected. |
Object | cell | Dom of the cell where mouse pointer is at. |
Object | row | Dom(tr) of row to be selected. |
Number | colNo | Index of the column where mouse pointer is at. Base on 0. |
Object | columnObj | Column object. |
Object | grid | Grid of the column resized. |
beforeColumnMove(  oldIndex,  newIndex)
Fired before column being moved.
Return Boolean - Return false to prevent column from being moved.
Number | oldIndex | Index of column to be moved. |
Number | newIndex | 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 Object | Data | record behind the row. |
Object | row | Dom(td) of row to be remove. |
Object | grid | 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.
Any | value | Value of the cell to be open for editing. |
Object or array | record | Data record of the row. |
Object | col | Column object. |
Object | grid | 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.
String | type | File type, could be xml/pdf/csv/xls. |
String | fileName | File name. |
String | url | Url specified to export data. |
String | name | Json name. Server side can get all the stuff by $_POST[name]. |
String | action | Reserved. |
String | fileName | 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 Object | Data | 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.
Object | requestParameter | 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 array | record | Data record of the row to be selected. |
Object | row | Dom(tr) of row to be selected. |
Number | rowNo | Index of the row where mouse pointer is at. Base on 0.. |
Object | grid | 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.
Object | requestParameter | 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 Object | Data | record to be updated. |
String | fieldName | Name of field to be updated. |
Any | newValue | 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 array | record | Data record of the row where the cell is at. |
Number | rowNo | Index of the row. |
Object | grid | Grid object. |
exportFailure(  respD,  respD,  e)
Fired when failing to export data to xml/excel/pdf etc. The following is a default implementaion.
String | respD | .exception record to be updated. |
Boolean | respD | .success Name of field to be updated. |
String | e | .message Error message description. |
loadFailure(  respD,  respD,  e)
Fired when failing to load data from server. The following is a default implementaion.
String | respD | .exception record to be updated. |
Boolean | respD | .success Name of field to be updated. |
String | e | .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.
String | response | Response plain text content. |
Object | requestParameter | 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.
Any | value | Value of the cell where mouse pointer is at. |
Object or array | record | Data record of the row where the cell is at. |
Object | cell | Dom(td) of the cell. |
Object | row | Dom of row where the cell is at. |
Number | colNo | Index of the column where the cell is at. |
Object | columnObj | Column object. |
Object | grid | 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.
Any | value | Value of the cell where mouse pointer is at. |
Object or array | record | Data record of the row where the cell is at. |
Object | cell | Dom(td) of the cell. |
Object | row | Dom of row where the cell is at. |
Number | colNo | Index of the column where the cell is at. |
Object | columnObj | Column object. |
Object | grid | Grid of the cell clicked on. |
onComplete(  grid)
Fired when grid is completely loaded. Refresh/sort/paging will also fire this event
Object | grid | 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.
Any | value | Value of the cell where mouse pointer is at. |
Object or array | record | Data record of the row where the cell is at. |
Object | cell | Dom(td) of the cell. |
Object | row | Dom of row where the cell is at. |
Number | colNo | Index of the column where the cell is at. |
Number | rowNo | Index of the row where the cell is at. |
Object | columnObj | Column object. |
Object | grid | 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.
Object | event | See Sigma.Grid.Event. |
Object | headCell | Dom of the head cell. |
Object | colObj | Column object. |
Object | grid | 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.
Object | event | Browser raw event object. |
onMouseMove(  value,  record,  cell,  row,  colNo,  rowNo,  columnObj,  grid)
Fired when mouse pointer is moving over grid.
Any | value | Value of the cell where mouse pointer is at. |
Object or array | record | Data record of the row where mouse pointer is at. |
Object | cell | Dom(td) of the cell. |
Object | row | Dom of row where mouse pointer is at. |
Number | colNo | Index of the column where mouse pointer is at. |
Number | rowNo | Index of the row where mouse pointer is at. |
Object | columnObj | Column object. |
Object | grid | Grid object. |
onMouseOut(  value,  record,  cell,  row,  colNo,  rowNo,  columnObj,  grid)
Fired when mouse pointer is to be out of grid.
Any | value | Value of the cell where mouse pointer is at. |
Object or array | record | Data record of the row where mouse pointer is at. |
Object | cell | Dom(td) of the cell. |
Object | row | Dom of row where mouse pointer is at. |
Number | colNo | Index of the column where mouse pointer is at. |
Number | rowNo | Index of the row where mouse pointer is at. |
Object | columnObj | Column object. |
Object | grid | Grid object. |
onMouseOver(  value,  record,  cell,  row,  colNo,  columnObj,  grid)
Fired when mouse pointer is over grid.
Any | value | Value of the cell where mouse pointer is at. |
Object or array | record | Data record of the row where mouse pointer is at. |
Object | cell | Dom(td) of the cell. |
Object | row | Dom of row where mouse pointer is at. |
Number | colNo | Index of the column where mouse pointer is at. |
Object | columnObj | Column object. |
Object | grid | 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.
Object | row | Dom of row where mouse pointer is at. |
Boolean | chk | If row is to be checked or unchecked. |
Object | grid | 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.
Any | value | Value of the cell where mouse pointer is at. |
Object or array | record | Data record of the row. |
Object | cell | Dom(td) of the cell where mouse pointer is at. |
Object | row | Dom of the row . |
Number | colNo | Index of the column where mouse pointer is at. |
Object | columnObj | Column object. |
Object | grid | 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.
Any | value | Value of the cell where mouse pointer is at. |
Object or array | record | Data record of the row. |
Object | cell | Dom(td) of the cell where mouse pointer is at. |
Object | row | Dom of the row . |
Number | colNo | Index of the column where mouse pointer is at. |
Object | columnObj | Column object. |
Object | grid | 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.
String | respD | .exception record to be updated. |
Boolean | respD | .success Name of field to be updated. |
String | e | .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.
String | response | Response plain text content. |
Object | requestParameter | See DataExchange.Saving. |