Data Grid Object
EFGrid.getVisible()
Return the visibility of the data grid as true or false
var objGrid = eform.get('Grid1');
var val = objGrid.getVisible();
alert(val);
EFGrid.isReadOnly()
Return whether the data grid is read-only as true or false
var objGrid = eform.get('Grid1');
var val = objGrid.isReadOnly();
alert(val);
EFGrid.setReadOnly(true/false)
Set the data grid as read-only or not
Parameters:
- isReadOnly = true/false, for set read only to true or false and disable the input
var objGrid = eform.get('Grid1');
objGrid.setReadOnly(true);
EFGrid.setVisible (isVisible,isPermenant)
Set the data grid as visible or not
Parameters:
- isVisible = true/false, for set visible to true or false and disable the input
- isPermenant = Save the visible state or not. If this set to true, the visibility of the control is saved with the eform, if not that visibility control is one off only
var objGrid = eform.get('Grid1');
objGrid.setVisible(true,true);
EFGrid.getCellStatus(row,col)
Get a specific cell current status
Parameters:
- row = The row id, start from 1
- col = The column index, start from 0
Return:
- N = Normal input
- R = Read-only
- M = Mandatory input
var objGrid = eform.get('Grid1');
var val = objGrid.getCellStatus(0,0);
alert(val);
EFGrid.getData(row,col)
Get a specific cell data
Parameters:
- row = The row id, start from 1
- col = The column index, start from 0
var objGrid = eform.get('Grid1');
var val = objGrid.getData(0,0);
alert(val);
EFGrid.getColCount
Get number of columns
var objGrid = eform.get('Grid1');
var val = objGrid.getColCount();
alert(val);
EFGrid.getRowCount
Get number of rows
var objGrid = eform.get('Grid1');
var val = objGrid.getRowCount();
alert(val);
EFGrid.setCellStatus(row,col,status)
Set a specific cell current status
Parameters:
- row = The row id, start from 1
- col = The column index, start from 0
- status
- N = Normal input
- R = Read-only
- M = Mandatory input
var objGrid = eform.get('Grid1');
var val = objGrid.setCellStatus(0,0,'R');
alert(val);
EFGrid.setData(row,col,val)
Set a specific cell data
Parameters:
- row = The row id, start from 1
- col = The column index, start from 0
- val = The cell data value
var objGrid = eform.get('Grid1');
var val = objGrid.setData(0,0,'Customer A');
alert(val);
EFGrid.appendRow(row,value_array)
Append a row to data grid and start writing value to each cell(s)
Parameters:
- row = The row id
- 0 = Append on the first row
- 1 = Append on the second row
- null = Add a new row at the bottom
- value_array = ['Value 1','Value 2',...]
var objGrid = eform.get('Grid1');
objGrid.appendRow(0,['Value 1','Value 2']);
Change Data Grid Row Color
Change the data grid row color
var objGrid = eform.get('Grid1');
objGrid.htmlObj.lastChild.childNodes[0].rows[1]. style.background = '#CCCCCC';
Commenting is not enabled on this course.