Select other grid rows based on column value of selected row inside OnRowSelect() client side function

2 posts, 0 answers
  1. ankool
    ankool avatar
    50 posts
    Member since:
    Apr 2007

    Posted 11 Jul 2011 Link to this post


    I have a grid with multiple row select option set to true. I need to implement a function which is called on grid row select at client side and that function selects other rows in grid based on a column value. For example , Assume grid with 10 rows and 5 columsn,  if I select row 2 and my matching column value is also present in row 4 , row 7 and row 9. Then row 4, 7, and 9 should be automatically selected.

    Let me know how to implement this using client side function OnRowSelect ()

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Jul 2011 Link to this post

    Hello Ankool,

    You can achieve this by attaching the client event OnRowClick and select the desired rows.
    client side:
    function OnRowClick(sender, args)
           var dataItem = args.get_gridDataItem();
           var cell = dataItem.get_cell("ColumnUniqueName");
           var txt = cell.innerText;//accessing the cell value.
           dataItem .set_selected(true);
           var Grid = sender;
           var MasterTable = Grid.get_masterTableView();
           for (var i = 0; i < MasterTable.get_dataItems().length; i++)
               var row = MasterTable.get_dataItems()[i];
               var value = parseInt(row.get_cell("ColumnUniqueName").innerText);
               if (row.get_cell("ColumnUniqueName").innerText == "4") //Give your condition.

  3. DevCraft R3 2016 release webinar banner
Back to Top