select grid rows

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
m400mail
New User
Posts: 13
Joined: Wed Nov 19, 2014 3:39 am
First Name: Michael
Last Name: Krautscheid
Company Name: asMika
Contact:

select grid rows

Post by m400mail »

Hello to *ALL,

i have a grid and i want to checked/unchecked the Grid rows.
pic01.PNG
pic01.PNG (15.22 KiB) Viewed 496 times
the checkbox starts a Javascript to do this

Code: Select all


var myGrid = getObj("Grid01");
var myRows = myGrid.grid.getRecordCount();
var newVal = get("HdrCheckBox");

for (var x = 1; x <= myRows; x++) {
  myGrid.grid.setDataValue(x, "CK_PRINT", newVal);
}

This function sets the value for all rows.

if the user filters the lines, I only want to mark the filtered lines.
How can i do this

Thanks for your help
Michael
DanD
Profound User
Posts: 42
Joined: Wed Jun 14, 2017 12:06 pm
First Name: Dan
Last Name: Devoe
Company Name: Boston Warehouse Trading
State / Province: Massachusetts
Zip / Postal Code: 02062
Country: United States
Contact:

Re: select grid rows

Post by DanD »

Hi Michael,

Please try the following to only change the values of the rows that are not filtered out:

Code: Select all

var myGrid = getObj("Grid01");
var newVal = get("HdrCheckBox");

for (var x=0; x<=myGrid.grid.getRecordCount(); x++) { 
   if (!myGrid.grid.isRowFilteredOut(x)) { 
      myGrid.grid.setDataValue(x, "CK_PRINT", newVal); 
    }
   }
myGrid.grid.render();
-Dan
m400mail
New User
Posts: 13
Joined: Wed Nov 19, 2014 3:39 am
First Name: Michael
Last Name: Krautscheid
Company Name: asMika
Contact:

Re: select grid rows

Post by m400mail »

Hi DanD,

great the function runs .
thanks a lot
michael
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests