/* Test_gridRowLayoutReadOnly Inputs: items (Any Type) index (integer) lastReadOnlyIndex (integer) (Multiple) */ load( local!selection, a!gridRowLayout( contents:{ a!textField( label:"Name"&ri!index, value:ri!items[ri!index].name, saveInto:ri!items[ri!index].name, readOnly:rule!TDS_isEmpty(fn!wherecontains(ri!index,ri!lastReadOnlyIndex)) ), a!textField( label:"Number"&ri!index, value:ri!items[ri!index].number, saveInto:ri!items[ri!index].number, readOnly:true ) }, id:ri!index ) ) /* TEST_gridLayout */ load( local!items:{{id:1,name:"Apple",number:"9988"},{id:2,name:"Banana",number:"8899"},{id:2,name:"Carrot",number:"8899"}}, local!itemsToken, local!numberOfItems, local!saveValue:null, with( a!gridLayout( label:local!saveValue, selectable:true, headerCells:{ a!gridLayoutHeaderCell(label:"Name",align:"CENTER"), a!gridLayoutHeaderCell(label:"Number",align:"CENTER") }, columnConfigs:{ a!gridLayoutColumnConfig(width:"DISTRIBUTE"), a!gridLayoutColumnConfig(width:"DISTRIBUTE") }, rows:a!applyComponents( function:rule!Test_gridRowLayoutReadOnly( items:local!items, index:_, lastReadOnlyIndex:local!saveValue ), array:if(or(isnull(local!items), count(local!items) < 1), {}, 1+enumerate(count(local!items))) ), selectionValue:local!saveValue, selectionSaveInto:{ a!save(local!saveValue,save!value) } ) ) )