Use this board to ask questions or have discussions with other Rich Displays users.
m400mail
New User
Posts: 13 Joined: Wed Nov 19, 2014 3:39 am
First Name: Michael
Last Name: Krautscheid
Company Name: asMika
Contact:
Post
by m400mail » Thu Jun 14, 2018 6:37 am
Hello to *ALL,
i have a grid and i want to checked/unchecked the Grid rows.
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:
Post
by DanD » Thu Jun 14, 2018 9:50 am
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:
Post
by m400mail » Thu Jun 14, 2018 10:38 am
Hi DanD,
great the function runs .
thanks a lot
michael
Users browsing this forum: No registered users and 0 guests