Skip to main content
17-Peridot
October 11, 2021
Solved

Advanced Grid : Row selection and Edit doesn't work simultaneously.

  • October 11, 2021
  • 1 reply
  • 6405 views

Hi Folks,

 

I came across a requirement to Edit grid row and meanwhile it should be selected as well but thats not working when using Advanced Grid. Once isEditable property is checked, SelectedRows stops working and viceversa.

I want to make grid Editable and row should be highlighted while editing. Also the selectedRow should also be used as an input for a service.

If anyone figured out any workaround for this, do share your ideas.

 

Thingworx version: 8.5.6.b110

 

TIA.

 

Best answer by TanmeyTWX

Hi,

 

Instead of calling DB everytime user edits grid, I have used a DT infotable which would AddDataTableEntries on popup open and Purge the same on popup close. And having a router with 2 inputs i.e. one from Main service and other from this DT, is finally doing the job.

1 reply

16-Pearl
October 13, 2021

Hi @TanmeyTWX,

 

It is working to specification that IsEditable and RowSelection can not be simultaneously selected.

 

As a workaround, use EnableEditButton property with RowSelection instead of isEditable property.

With row(s) can be selected, the Grid editing is off.

Once Grid is in Editable mode by clicking the Edit button, row selection won’t be possible until Grid is non-editable.

 

Hope that helps.

TanmeyTWX17-PeridotAuthor
17-Peridot
October 14, 2021

Hi @TonyZhang 

 

Thanks for your reply. I guess I can use this workaround but I have got another issue with advanced Grid widget.

On load, Grid doesn't load particular entire column in edit mode but specific cell on click only unlike what was available in Thingworx 7 and previous version.

 

Issue description: If I have 3 rows in grid and tries to edit only one of them and use 'EditableTable' property to pass as an input for a service(refresh grid with edited value), it is always taking the edited row only instead of entire table.so when grid refreshes for edited values, it will not load all 3 rows again but one row.

 

Expectation: Grid should refresh with all the data even if only row gets edited.

 

attached is the screenshot of the same.

image a is before editing a value with total 3 rows

image b is after completing the edit with one row.

 

 

Any idea on this?

 

 

 

16-Pearl
October 15, 2021

Hi @TanmeyTWX

 

Yes, EditedTable only returns the specific row being edited is an expected behavior instead of returning the entire table in newer releases now - not sure exactly when this behavior changed though.

You should not simply pass the EditedTable to overwrite the entire data source for update.

If you use Datatable as a data source, you can use predefined AddOrUpdateDataTableEntries service to update the edited row only.

If you use infotable type thing properties as a data source, you will need to create a service to find that particular row being edited and update the record.