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");
Checkboxes in Grid
-
- Experienced User
- Posts: 119
- Joined: Wed May 25, 2016 11:58 am
- First Name: Patti
- Last Name: Shuey
- Company Name: Conestoga Wood Specialties
- Phone: 7174452886
- Address 1: 645 Reading Road
- City: East Earl
- State / Province: Pennsylvania
- Zip / Postal Code: 17519
- Country: United States
- Contact:
-
- 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: Checkboxes in Grid
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.
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.
-
- Experienced User
- Posts: 119
- Joined: Wed May 25, 2016 11:58 am
- First Name: Patti
- Last Name: Shuey
- Company Name: Conestoga Wood Specialties
- Phone: 7174452886
- Address 1: 645 Reading Road
- City: East Earl
- State / Province: Pennsylvania
- Zip / Postal Code: 17519
- Country: United States
- Contact:
Re: Checkboxes in Grid
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");
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");
-
- 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: Checkboxes in Grid
Hmmm... why are you setting them to the word "value"?
-
- 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: Checkboxes in Grid
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.
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.
Who is online
Users browsing this forum: Ahrefs [Bot] and 6 guests