Page 1 of 1

Grid Row Select

Posted: Wed Jul 19, 2017 1:04 pm
by James-S
I have tried javascript and bound field to the Row Select and I am not able to get it to work.

I want to set the Row Select based on whether or not the grid has rows.

I have tried this code in the onload of the control record format and the grid still executes the onrowclick. I may not be approaching this correctly. What is the best approach to prevent the onrowclick response when no rows have been loaded into the grid?

Code: Select all

var rowCount = getObj("FilterGrid").grid.getRecordCount();
if (rowCount === 0) {
  getObj("FilterGrid").grid.setProperty("row selection", "none");
} else {
  getObj("FilterGrid").grid.setProperty("row selection", "single");
}
Thanks in advance!

Re: Grid Row Select

Posted: Thu Jul 20, 2017 3:40 pm
by Scott Klement
I don't understand what the code you've provided has to do with onrowclick? As far as I can tell it's completely unrelated to onrowclick...

if you want to prevent onrowclick from doing anything, just put an "if" statement in the "onrowclick" event that prevents any code from running...