/* Test_gridRowLayoutReadOnly Inputs: items (Any Type) index (integer) lastReadOnlyIndex (integer) */ 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:not(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:"Rahul",number:"9988"},{id:2,name:"Raj",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), a!save(local!numberOfItems,count(local!saveValue)), a!save(local!saveValue,if(local!numberOfItems>1,remove(local!saveValue,1),local!saveValue)) } ) ) )