Hi,
In my grid, I defined data key for each row:
<ig:gridView dataSource="#{gridBean.dataSource}" dataKeyName="caseId" ... >
and cell clicked function is zap()
<ig:gridClientEvents cellClicked="zap"/>
In zap() function,
function zap(sender, args){ if(args==null) return;
var evnt = args.get_browserEvent(); if(evnt==null || evnt.target==null) return;
...}
How to you get data key?
thanks.
Hello yzbythesea,
If caseId is displayed in WebGrid it’s value can be easily accessed using client event. Below is the JavaScript function. If this doesn’t meet your requirement, please let us know whether or not 'caseId' is included in <ig:column> tag to be displayed in WebGrid.
function onCellClick(sender, args) {
var cell = new IgGridCell(args.get_browserEvent().target);
var rowIndex = cell.getRowIndex();
var caseId = cell.getParentRow().elm.cells[1].firstChild.textContent;
alert(caseId);
}
Thank you,
Swetha