how to reset selected rows in grid-Advanced widget via JSON Configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
how to reset selected rows in grid-Advanced widget via JSON Configuration
Hi,
I am using "gridAdvaced" widget in Thingworx (9.0) Mashup.
The grid configuration is written in one service.
In the service JSON is created with following code to clear the selection of grid :
"columns":{
.
.
.
},
"rows":
{
"selection":"multi",
"defaultSelectedRows":(NoOfRecords+1).toString(),
"autoScroll":false
},
"styles":{
.
.
.
}
I want the selected rows to get disselected whenever I change the page/ or data in the grid is changed.
The service is triggered on grid view button and page change event.
But if I select any row in the grid and then change the page or click the view button again (to trigger the configuration service), the selected row remain selected even if the data in the grid is changed.
Please suggest a workable solution ASAP.
Thank you in advance.
Solved! Go to Solution.
- Labels:
-
Coding
-
Design
-
Mashup-Widget
-
Troubleshooting
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Rocky_2021 ,
You can create a service/function to set the "DefaultSelectedRows" property of grid-Advanced widget.
The service/function will return (number of records +1) or (some big value like 99999). (PFA)
To make this work in your case :
- Please remove the configuration binding,
- then bind the above mentioned binding and
- rebind the configuration,
- Trigger the above service/function on reequired events, page change event, button click event.
This work-around must work.
& PTC have resolved this issue in later versions so if you are using 9.1 or later, Reset property of grid-Advanced widget will also work.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
My immediate thought is to use the "Reset" event on the advanced grid.
But I wonder if it would work for your specific use case?
Another option could be (I haven't tested this myself) to add a service that has an empty infotable of the same data shape as your grid and put it as the selected rows in the advanced grid each time you do something where you want to remove the selected rows.
Hope this gives you some inspiration to find a solution.
Regards,
Jens
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Reset functionality is also not working to clear the selection.
- Loading empty infotable and reloading the data infotable takes few seconds, and it does not look good aesthetically.
But thanks for your suggestion, I will try to find some more ways to find solution/work-around for this.
Meanwhile anyone can please find the solution and share it.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Rocky_2021 ,
You can create a service/function to set the "DefaultSelectedRows" property of grid-Advanced widget.
The service/function will return (number of records +1) or (some big value like 99999). (PFA)
To make this work in your case :
- Please remove the configuration binding,
- then bind the above mentioned binding and
- rebind the configuration,
- Trigger the above service/function on reequired events, page change event, button click event.
This work-around must work.
& PTC have resolved this issue in later versions so if you are using 9.1 or later, Reset property of grid-Advanced widget will also work.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks Buddy, This is working as expected.
