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

Selected true not working on Sort datetime #52

Open
Schouw opened this issue Aug 3, 2019 · 0 comments
Open

Selected true not working on Sort datetime #52

Schouw opened this issue Aug 3, 2019 · 0 comments

Comments

@Schouw
Copy link

Schouw commented Aug 3, 2019

When a sort button (i have only tried the dropdown menu version) is set with data-type="datetime" and data-selected="true", this does not select the sort on jp list init.

I have set the data-datetime-format and the sorting workings just as intended if the dropdown menu item is selected by the user. It is simply not selected as the default when the page is first loaded.

`

      <button
            data-type="panel"
            class="btn btn-primary dropdown-toggle"
            type="button">
                Sort by
       </button>

                        <div
                                data-type="content"
                                class="dropdown-menu"
                                aria-labelledby="dropdownMenuButton">

                            <a class="dropdown-item"
                               href="#"
                               data-path="default">-- No sort --</a>

                            <a class="dropdown-item"
                               href="#"
                               data-path="#article-publication-status"
                               data-order="asc"
                               data-type="datetime"
                               data-selected="true"
                               data-datetime-format="dd/MM - yyyy HH:mm">Created Newest-Oldest</a>

                            <a class="dropdown-item"
                               href="#"
                               data-path="#article-publication-status"
                               data-order="desc"
                               data-type="datetime"
                               data-datetime-format="dd/MM - yyyy HH:mm">Created Oldest-Newest</a>

                        </div>
                    </div>
                    <!-- Sort button -->

`

Test data
<table class="table table-striped table-sm" data-jplist-group="articles"> <thead class="thead-dark"> <tr> <th scope="col" class="w-50">Title</th> <th scope="col" class="w-25">Status</th> <th scope="col" class="w-25">Created</th> </tr> </thead> <tbody> <tr data-jplist-item> <td scope="row" id="article-title">dafafd</td> <td id="article-publication-status">UNPUBLICED</td> <td>03/08 - 2019 16:07</td> </tr> <tr data-jplist-item> <td scope="row" id="article-title">Tester</td> <td id="article-publication-status">DRAFT</td> <td>02/08 - 2019 23:51</td> </tr> </tbody> </table>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant