Page 1 of 1
Checkboxes in Grid
Posted: Tue Oct 31, 2017 10:20 am
by pjshuey
I have a grid with 4 checkboxes in the row. I want to be able to check the first box and have the next 3 automatically checked. Typically I would use applyProperty of the field type to re-render the field, but this does not work in a grid. How can I get the new values to re-render in the grid? Below is the javascript in my onClick event.
var value = getObj("SFDATA").grid.getDataValue(row, "L5PRT1");
getObj("SFDATA").grid.setDataValue(row, "L5PRT2", "value");
getObj("SFDATA").grid.setDataValue(row, "L5PRT3", "value");
getObj("SFDATA").grid.setDataValue(row, "L5PRT4", "value");
Re: Checkboxes in Grid
Posted: Tue Oct 31, 2017 10:47 am
by Scott Klement
The standard applyProperty method should work fine, as long as you only do it on rows that have already been on the display. Since you say you want the user to click the first checkbox in the row, that should work fine, right?
The only difference between doing it in the grid vs elsewhere is that you have to append the row number. So you do applyProperty("myid.1" instead of just "myId" to get row 1. Always append a period followed by the row number to the id.
Re: Checkboxes in Grid
Posted: Tue Oct 31, 2017 11:00 am
by pjshuey
Scott,
Below is my code, but it does not update the checkboxes....
var value = getObj("SFDATA").grid.getDataValue(row, "L5PRT1");
getObj("SFDATA").grid.setDataValue(row, "L5PRT2", "value");
applyProperty("L5PRT2.1", "field type", "checkbox");
getObj("SFDATA").grid.setDataValue(row, "L5PRT3", "value");
applyProperty("L5PRT3.1", "field type", "checkbox");
getObj("SFDATA").grid.setDataValue(row, "L5PRT4", "value");
applyProperty("L5PRT4.1", "field type", "checkbox");
Re: Checkboxes in Grid
Posted: Tue Oct 31, 2017 4:20 pm
by Scott Klement
Hmmm... why are you setting them to the word "value"?
Re: Checkboxes in Grid
Posted: Tue Oct 31, 2017 4:41 pm
by Scott Klement
If you're still stuck, would you mind posting your display file? That would make it a lot easier for me to know exactly what to tell you.
An easy way to do that is to open it in the Visual Designer, then do a Save As and choose "local file". This will save it to your PC, then you can use the "attachments" option in the forum to upload it.