This is a migrated thread and some comments may be shown as answers.

Client-Side column value in context-menu

1 Answer 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Phil
Top achievements
Rank 2
Phil asked on 24 Mar 2010, 01:41 PM
Hello All:
I have a context-menu on a grid.  I have a non data-key (the 'lblStatus'), that I would like to cancel or continue the context menu.  So during the standard 'RowContextMenu' javascript function, I need to a reference to 'lblStatus'.  I believe that the following gets the data grid row.
var dataItem = Sender.get_masterTableView().get_dataItems()[index]; 

How do i obtain a reference to the status value?
Thanks.
Phil

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 24 Mar 2010, 02:39 PM
Hello Phil,

The following code shows how to get the cell value in RowContextMenu event.

JavaScript:
 
 function RowContextMenu(sender, eventArgs) { 
        var index = eventArgs.get_itemIndexHierarchical(); 
        var dataItem = sender.get_masterTableView().get_dataItems()[index]; 
        var cell = sender.get_masterTableView().getCellByColumnUniqueName(dataItem, "lblStatus"); 
        alert(cell.innerHTML); // Cell value 
    } 

Regards,
Princy.
Tags
Grid
Asked by
Phil
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or