BjornAugust 22, 2016 at 5:26 am #2466
env: SPARK UI 4.4.1 EE, Heritage human service
I have a Table with 10 records and multiple columns. I then call Table search() across all the columns using a regex, which removes let’s say 4 of the 10, leaving 6 records still showning in the table.
If I call the Table clear() function at this point, 6 records are removed. I was a bit surprised of this because the JSDoc states that *all* records would be cleared. But ok, it is logical to only clear items that you can see. Maybe a comment would help in the JSDoc.
ISSUE: After clearing the search spec, to show the remaining records, it appears that there are still some of the cleared records left in the table. 6 records were indeed removed, but it was the 6 first records in the unfiltered table that was removed, not the filtered ones.
Am I doing anything wrong here?
/BjornSPARK SupportAugust 22, 2016 at 2:40 pm #2468
I have replicated your issue here using BPM 8.5.7 with the latest SPARK UI Toolkit. This appears to be happening as the clear method is grabbing the index of the UI control, which is set to 0 (if only one row is displayed) and clearing the data at index 0. Therefore, your code is correct, but not the recommended approach.
Normally, you will have data populated into the table from an external source. If the data is populated using an SQL statement in a server-side script, then a path can be added to execute a delete query on any matching data with a Stay-on-page event. Then the table should refresh with the remaining data.
Stephen P.BjornAugust 22, 2016 at 11:23 pm #2469
ok, that could work for a SQL data source. However, I still think there is a use case for the local clear() method; I’m using this to iteratively narrow down locally shown records, and I don’t want to modify the server data for other sessions/users. To do that by appending more and more complex server side query constraints seems overkill. Also, server round-trips should not be necessary for this kind of filtering.
/BjornSPARK SupportAugust 24, 2016 at 11:03 am #2479
After discussing this with the Development Team, I have logged a bug for the clear() method. As the documentation indicates, the clear method should remove all items from the table whether it is filtered or not.
We will implement the fix in an upcoming release. Thank you for reporting this issue to us.
You must be logged in to reply to this topic.