Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
245
get selected value of cell with javascript
posted

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.

Parents
No Data
Reply
  • 245
    Verified Answer
    posted

    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.

Children