Skip to main content

Based on the value of a field in a table I want to render a row either as read only with no select boxes or editable with select check boxes.

For example:

There is a check box field in each row of the table entitled “Is Active?” If “Is Active” is checked then the row should render editable with a select check box. If “Is Active” is not checked the row should load read only without a select check box.

Tami,

Here’s one idea:

Add a custom renderer for your editable fields. Your snippet has access to the row so you can check whether the row “Is Active” and depending on the value set the field to Read or Edit. You can also add a dummy class to one of the ancestor elements (using jQuery). You can use this class along with Skuid standard CSS to conditionally hide the select check box by row.

Make sense?

Regards,
Irvin


Another idea is to click on the standard “edit” row action and just add a condition under Rendering where it only renders if the record is active. This will get rid of the edit icon but you will still have to use Javascript to hide the select checkbox. 


Brilliant


Thanks!


Thanks for the ideas! I have not tested them yet but I think the issue I will run into is if I set a condition under rendering to only render if the record is active than I will not see the none active records. See I need to see the records that are active and not active. With the active being editable and the non active being read only. 


What Anna is suggesting is that you show all records,  add an “edit rows”  row action, and conditionally render that button so it only shows if you active flag is set for the record.  The rendering is evaluted row by row. 

Then you can use Irvin’s idea to change the other rows to “Read Only” 


I second that, Brilliant!!


I don’t follow how this works. How are you referring to row context to get the value of a field in a specific row here? It seems not possible to refer to row context to get a field value, the only thing you can read it seems is “row property” in a render condition on a row. Also, even if the edit button is hidden to try and prevent you from editing a row, it’s still possible to double click on a field in a row to edit it. The table would need to be read only and the edit button be a custom popup editor, but still I don’t see how you are referring to a field value via row context in the render conditions on the button; every way I try to set this up it doesn’t work and there is no “row field value” as an option to choose from.