Grid Row Select

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
James-S
Profound User
Posts: 61
Joined: Tue Jun 28, 2016 12:53 pm
First Name: James
Last Name: Sherwood
Company Name: Brunswick Boat Group
City: Knoxville
State / Province: Tennessee
Contact:

Grid Row Select

Post 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!
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Grid Row Select

Post 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...
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest