I am building a form using N/ui/serverWidget. I ha...
# suitescript
t
I am building a form using N/ui/serverWidget. I have a sublist that features a checkbox for each row:
Copy code
var checkbox = sublist.addField({
          id : 'custbody_the_id',
          label : 'Label Goes Here',
          type : ui.FieldType.CHECKBOX
         });
I add lines to this sublist from a saved search result:
Copy code
for(var i = 0; i < results.length;i++){
   sublist.setSublistValue({
            id: 'id',
            value: results[i].id,
            line: i
      });
}
I would like to conditionally disable the checkbox for a given row based on criteria. I have tried using:
Copy code
checkbox.updateDisplayType({
           id: 'custbody_the_id',
           displayType: 'disabled',
           line: i 
      });
However this disables the checkbox for the entire row. How can I target only specific checkboxes?
*This disables checkboxes for the entire sublist
b
You can change the sublist type
Or use client script to disable or normalize each time a row is selected
I believe the list type sublist can have specific rows disabled
c
you have access to a client script and lineInit which i'd probably use to disable upon entry
t
I am using Nui.SublistType.LIST