#Refresh updated filtered table

1 messages · Page 1 of 1 (latest)

fair cloak
#

Hello,
I have a table with the possibility to select multiple rows and updated the selected rows using a button (there's a column "type" which can be changed using a dropdown list, and an "update button")
The table is set to use as datasource the return value of an async JS function. In this function i'm joining data from different queries.

When the update button is pressed, the update runs smoothly, all the data gets reloaded, the selection on the previously selected rows where data has been updated disappear...however "selectedRows" array property of the table is not empty but contains a number of empty items equal to the previously selected ones!
Help please? 🙂

#

Try to explain with images:

  • Filtered the table with the users firstname (random filter i could think of)
  • select the rows i want to update
  • update the rows in bulk using the button and the dropdown you see in the upper part of the screenshot
  • selected rows property coorrectly shows 2 items with 20 keys each
#
  • Pressed the Apply button, the update query runs without any issues
  • The button actually performs the update + a refresh on the data (i'll paste my JS later)
  • selectedRows property shows 2 items, with 0 keys (????)
#

this is the code being run when pressing the Apply button

    async bulkApplyType(){
//show loading modal
        showModal(modLoading.name)
//retrieve selected IDs
        let selectedFeedback = tbCoordinators.selectedRows.map(e => "'" + e.feedbackId + "'")
//retrieve the type to set all the selected feedbacks to
        let bulkType = cboTypeBulk.selectedOptionValue
//update
        await updateFeedbackBulk.run({type: bulkType, feedbackId: selectedFeedback})
//re-run all the queries to obtain updated data
        await this.loadData()
//perform a join on the updated data to obtain the final data used by the table
        await this.getData()
//close loading modal
        closeModal(modLoading.name)
    },
#

table data set via propety of the table itself, manipulation is the name of the JS object