How do you get the selected value of a row/cell via javascript? I have a double-click event that fires a javascript call and I'd like to get the value from a cell from the row that they selected. I did look through forum, documentation, etc and found lots of suggestions but nothing seems to work for me.
WebDataGrid version 10.3.20103.1013
thank you for any help you can provide.
This simply does not work:
Microsoft JScript runtime error: Unable to get value of the property 'get_behaviors': object is null or undefined
hi can u please help me to get the value from selected cell in hierarchical webdatagrid!!!
Figured this one out. Took a while to get it so I thought I would pass along the answer:
HOW TO GET VALUE FROM SELECTED CELL IN WEBDATAGRID via BLOCKED SCRIPT
1.
on double click event you can use event args…
eventArgs.get_item().get_row().get_cellByColumnKey("column_name").get_text()
2.
You can reference the grid also with the sender argument if it is used in an event
sender.get_behaviors().get_selection().get_selectedRows(0).getItem(0).get_cellByColumnKey("columnname").get_text()
3.
You can just reference the grid directly
var grid = ig_controls["gridName"];
var value = grid.get_behaviors().get_selection().get_selectedRows(0).getItem(0).get_cellByColumnKey("column_name").get_text()
Hope this helps someone.