Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple-sort extension dont work (only update the icons) #4616

Closed
tafadzwagonera opened this issue Sep 30, 2019 · 10 comments · Fixed by #5495
Closed

Multiple-sort extension dont work (only update the icons) #4616

tafadzwagonera opened this issue Sep 30, 2019 · 10 comments · Fixed by #5495
Labels
confirmed Issues that have been confirmed with a reduced test case and identify a bug. has PR Issues that has been fixed with a PR. multiple-sort Issues for the multiple-sort extension.

Comments

@tafadzwagonera
Copy link

tafadzwagonera commented Sep 30, 2019

I followed the instructions here https://bootstrap-table.com/docs/extensions/multiple-sort/#multiplesort to create a table with multiple sortable columns. I've minified the js I found here https://github.com/dimbslmh/bootstrap-table/tree/master/src/extensions/multiple-sort using various tools online.

HTML

<table 
    id="js-bootcamp-list"
    data-search="true"
    data-toolbar="#toolbar"
    data-show-toggle="true"
    data-show-fullscreen="true"
    data-click-to-select="true"
    data-show-columns="true"
    data-detail-view="true"
    data-page-list="[25, 50, 100, 200, All]"
    data-show-multi-sort="true"
    data-show-multi-sort-button="true"
    class="table-striped table-condensed">
    <thead>
        <tr>
            <th 
            data-field="logo"
            data-sortable="false"
            data-align="center"
            data-valign="middle"></th>
            <th 
            data-field="name"
            data-sortable="true"
            data-align="center"
            data-valign="middle">School/College</th>
            <th 
            data-field="description"
            data-visible="false">Description</th>
            <th 
            data-field="reviews"
            data-sortable="true"
            data-align="center"
            data-valign="middle">Aggregate reviews</th>
            <th 
            data-field="duration"
            data-sortable="true"
            data-align="center"
            data-valign="middle">Duration</th>
        </tr>
  </thead>  
</table>

JS

var init = function (args) {
    // body...
    $bootcampList.bootstrapTable({
        sortPriority: [
            {'sortName':'reviews', 'sortOrder':'desc'}, 
            {'sortName':'duration', 'sortOrder':'desc'}
        ],
        data: data,
        detailFormatter: detailFormatter,
        rowAttributes: rowAttributes,
        undefinedText: "N/A"
    });
}

Unfortanetly on page load when init function is fired up. The table doesn't sort data in reviews and duration columns.

@UtechtDustin
Copy link
Collaborator

Please provide us an example using our online editor instead of posting some code.

@UtechtDustin UtechtDustin added the needs example Need an example in order to confirm the issue or the PR. label Sep 30, 2019
@wenzhixin
Copy link
Owner

@wenzhixin wenzhixin added docs Issues for improving or updating our documentation. has PR Issues that has been fixed with a PR. and removed needs example Need an example in order to confirm the issue or the PR. labels Oct 5, 2019
@vivek-kandhvar
Copy link

@tafadzwagonera working example: https://live.bootstrap-table.com/code/wenzhixin/853

Multi-sort extension never works! I don't know how others are even using this. The example you claim which is working above, doesn't work if I change 'desc' to 'asc' and run it!

It also doesn't work if I change it from the multi sort modal options!

So just wanted to understand, if the functionality of this library is to only update the sort icon?

@UtechtDustin UtechtDustin reopened this Oct 6, 2020
@UtechtDustin UtechtDustin added confirmed Issues that have been confirmed with a reduced test case and identify a bug. multiple-sort Issues for the multiple-sort extension. and removed docs Issues for improving or updating our documentation. has PR Issues that has been fixed with a PR. labels Oct 6, 2020
@UtechtDustin UtechtDustin changed the title Sorting multiple columns not working for bootstrap table v1.15.4 Multiple-sort extension dont work (only update the icons) Oct 6, 2020
@vivek-kandhvar
Copy link

Any update on this issue yet? Appreciate your quick response.

@UtechtDustin
Copy link
Collaborator

@vivek-kandhvar No new news, sorry.
If there is a update we will write it in this isue or we will link the pull request which fix this issue.

@vivek-kandhvar
Copy link

Ah ok! Was really looking forward to use this feature in my product. Sad it's broken.
Will look forward for the fix.

Thanks

@wenzhixin
Copy link
Owner

@UtechtDustin Has the PR (#5329) fixed this problem?

@UtechtDustin
Copy link
Collaborator

UtechtDustin commented Dec 14, 2020

@wenzhixin no, the PR only fixed the visiblity of icons not the function of thhe extension.

This was referenced Dec 17, 2020
@Naruto-kyun
Copy link
Contributor

Took me some hours, to find out, but seconds to fix...
the extention update this.data, then this.initBody() load this.options.data, so reorder this.options.data instead fix the issue

@wenzhixin wenzhixin added the has PR Issues that has been fixed with a PR. label Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed Issues that have been confirmed with a reduced test case and identify a bug. has PR Issues that has been fixed with a PR. multiple-sort Issues for the multiple-sort extension.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants