wenzhixin / bootstrap-table

An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation, Vue.js)
https://bootstrap-table.com/
MIT License
11.73k stars 4.44k forks source link

Extension "Group By V2" crashes with pagination #5334

Open snoopy72 opened 3 years ago

snoopy72 commented 3 years ago

Bootstraptable version(s) affected: Current version (1.18.0)

Description
Using the "Group By V2" plugin (option "groupBy") together with pagination crashes: TypeError: this.tableGroups is undefined (Output of browser-developer-tools)

Example
https://live.bootstrap-table.com/code/snoopy72/4894

The formatting might not be pretty, but (i think) it's more easy to reproduce the problem.

Comment out this line

    pagination: true,sidePagination: "server",pageList: [10, 25, 50],
TO
    // pagination: true,sidePagination: "server",pageList: [10, 25, 50],

and rerun the example. Then the grouping is working (= without pagination).

Possible (optional)
The current solution (without pagination) might be useful for only a few data, but i have several hundrets of data. so pagination is mandatory for me.

Maybe this might be more a feature than a bug ... from my point of view i would like declare it as bug.

UtechtDustin commented 3 years ago

this.tableGroups will be initialised in the initSort function, which will not be executed wiht sidePagination: "server".

https://github.com/wenzhixin/bootstrap-table/blob/develop/src/bootstrap-table.js#L436-L439 https://github.com/wenzhixin/bootstrap-table/blob/develop/src/extensions/group-by-v2/bootstrap-table-group-by.js#L47-L52

We will check if we find a solution for that!

serlogo53 commented 3 years ago

we are waiting this fix.. have a nice work..