function AddLine(gridView) { var selectedRows = GetSelectedRows(gridView); var columnsCount = gridView.get_columns().get_length(); SetNonSelectedRowsBackground(gridView); for (var i = selectedRows.get_length() - 1; i >= 0; i--) { if (gridView._level == 0) { if (selectedRows.getItem(i).get_cellByColumnKey("Hidden Status Flag").get_value() == "WITHDRAWN") { selectedRows.getItem(i).get_element().className = 'whdggridselectedrowwithdrawn'; } else { switch (selectedRows.getItem(i).get_cellByColumnKey("Alert").get_value()) { case 2: selectedRows.getItem(i).get_element().className = 'whdggridselectedrow'; //selectedRows.getItem(i).get_cellByColumnKey("Alert").get_element().className = 'whdggridcelloverdue whdggridselectedrow'; break; case 1: selectedRows.getItem(i).get_element().className = 'whdggridselectedrow'; break; case 0: selectedRows.getItem(i).get_element().className = 'whdggridselectedrow'; break; } } } else { if (selectedRows.getItem(i).get_cellByColumnKey("Hidden Status Flag").get_value() == "WITHDRAWN") { selectedRows.getItem(i).get_element().className = 'whdggridselectedrowwithdrawn'; } else { switch (selectedRows.getItem(i).get_cellByColumnKey("Alert").get_value()) { case 2: selectedRows.getItem(i).get_element().className = 'whdggridselectedrow'; break; case 1: selectedRows.getItem(i).get_element().className = 'whdggridselectedrow'; break; case 0: selectedRows.getItem(i).get_element().className = 'whdggridselectedrow'; break; } } } } } function SetNonSelectedRowsBackground(gridView) { var gridRows = gridView.get_rows(); var columnsCount = gridView.get_columns().get_length(); for (var i = gridRows.get_length() - 1; i >= 0; i--) { //Must check for withdrawn style if (gridRows.get_row(i).get_cellByColumnKey("Hidden Status Flag").get_value() == "WITHDRAWN") { gridRows.get_row(i).get_element().className = 'whdggridrowwithdrawn'; } else { gridRows.get_row(i).get_element().className = 'whdggridrow'; } } } function GetSelectedRows(gridView) { return gridView.get_behaviors().get_selection().get_selectedRows(); // gets the selected rows for the grid view } function GetChildGridView(gridView) { if (gridView._level == 0) AddLine(gridView); var rows = gridView.get_rows(); // gets a reference to the container grid's rows for (var i = 0; i < rows.get_length(); i++) { var childGridView = rows.get_row(i).get_rowIslands()[0]; // gets reference to the child grid view if (childGridView) { AddLine(childGridView); // adds a line with the current selected row to the DIV element GetChildGridView(childGridView); } } } function GetSelectedGridRow() { var grid = $find("whdg"); GetChildGridView(grid.get_gridView()); }