qTable with select all and pagination



  • Hello,

    I am using qtable with pagination and select all options. On selecting select all icon, only the items on the current page get selected. Can someone please let me know if select all can be made to select all rows across all pages of the qtable?

    Thanks
    HP



  • With “select all icon” you mean the checkbox in the table head that appears when you set selection="multiple" on the QTable, right?
    I don’t know how to modify that, but you could use an external button and set the selected property to your whole table data array.

    <q-table
        :data="tableData"
        selection="multiple"
        :selected.sync="selected"
        ....
    </q-table>
    
    <q-btn label="click me" @click="buttonClicked" />
    
    {
        buttonClicked() {
            this.selected = this.tableData;
        }
    }
    


  • @chyde90 Yes I meant checkbox in the table header itself. Yeah, I did think about the second approach you mentioned. But was wondering if there was a way of doing it without having to write my own code.


Log in to reply