Need to reset editable grid

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

Parents
  • Hi

    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.

Reply Children
No Data