Hi ,
I have one editable grid where selected rows are not getting reset.
1. Table is having 10 rows
2. Selected 3rd n 4th rows by clicking on checkbox at the right most side.
3. I have one reset button with that i make all values null like all filter values and other local variable.
But after refreshing selected 3rd n 4th rows are not getting deselect.
Ideally after reset all rows should be display like the default grid rows.
Any idea which property used to reset to make un select all rows.
Discussion posts and replies are publicly visible
I am using a!gridField where i am unable to find any properties which can hold this count . As we have options in
a!gridLayout - selectionValue: local!selected, selectionSaveInto: local!selectedHow we can achieve same thing here.
local!selected is an array with the index of the value selected (i.e. 3,4) , if you want to reset, you should do in an a!save(local!selected,null) inside your reset button.
selected: local!selected
I have used this way also where i am keeping local!selected under selected property of gridField. But as per document selected property is not available for gridField
In other way also tried . I have tried to save value of gridField in local!selected variable n tried to reset by assigning null in reset link. But nothing is happening.
We have no way of knowing what the issue might be unless you post your code here (or a representative sample of it, including your grid definition with selections, as well as the button/control you're trying to use to deselect). Any answer we could provide before this would be pure guesswork.
Hi sauravk
To what I understood from you post, You want to reset all selections on the click of reset button.
You can try something like this
load( local!selected: tointeger({}), local!resetAction, local!data: { { id: 1, name: "abc", contact: 1234 }, { id: 2, name: "pqr", contact: 5678 }, { id: 3, name: "lmn", contact: 3452 } }, with( { a!gridLayout( label: "Test", totalCount: count(local!data), headerCells: { a!gridLayoutHeaderCell( label: "ID" ), a!gridLayoutHeaderCell( label: "NAME" ), a!gridLayoutHeaderCell( label: "CONTACT" ) }, rows: a!forEach( local!data, a!gridRowLayout( id: fv!index, contents: { a!integerField( value: fv!item.id, readOnly: true() ), a!textField( value: fv!item.name, saveInto: fv!item.name ), a!integerField( value: fv!item.contact, saveInto: fv!item.contact ) } ) ), selectable :true(), selectionValue: local!selected, selectionSaveInto : local!selected ), a!buttonLayout( primaryButtons: { a!buttonWidget( label:"Reset", value: null, saveInto: local!selected ) } ) } ) )
I had already fixed this. Your assumetion is very correct. Button was outside the with() . Due to that grid total count check was now working. Now I kept inside and its working fine with totalCount properties.