Trigger q-table refresh [solved]



  • I have q-table with data from server. When creating new record i want to refresh data from server. I don’t understand how to do this.



  • @star You can just call the method you use for @request property, with the current pagination and filter objects if you use them :

    // Attached to @request prop of q-table
    onRequest(prop) {
          const { page, rowsPerPage, sortBy, descending } = props.pagination
          const filter = props.filter
    // ...
    }
    
    onAddRecord() {
      // add the record
      // ...
      // Refresh
      this.onRequest({ filter: this.filter, pagination : this.pagination})
    }
    


  • @tof06 Thank You! It works like a charm. I don’t know why I didn’t think of it.


Log in to reply