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

Sort #45

Open
papusa opened this issue May 25, 2017 · 5 comments
Open

Sort #45

papusa opened this issue May 25, 2017 · 5 comments

Comments

@papusa
Copy link

papusa commented May 25, 2017

Hi,

How does sorting works? Does it require only sortable attribute to be set to true or needs some additional handlers?

In demos here: https://roxus.github.io/paper-datatable-api/components/paper-datatable-api/#paper-datatable-api sorting doesn't work on chrome (Version 58.0.3029.110 (64-bit)), but works on firefox.
Locally sort is not working on any browser.

Thanks

@RoXuS
Copy link
Owner

RoXuS commented Jun 1, 2017

Hello @papusa,

Sort works on my Chrome (same version).

You have to do the sort on your backend or with a specific function (see https://github.com/RoXuS/paper-datatable-api/blob/master/demo/advanced-pagination-front-side-demo.html).

@drdreo
Copy link

drdreo commented Jun 16, 2017

Hi, im very happy that i've found a working paper-datable component now after days of searching for some that is still developed. Nonetheless, i think this is quiet the right place for this issue.

If i click on sort, whether with my implementation of your sort algorithm or yours on your demo here:

It gets sorted, fine. But if you continue spamming the sort button, you have to click twice when the arrow points downwards to get it sorted the other way. What causes that?

@RoXuS
Copy link
Owner

RoXuS commented Jun 16, 2017

Hi @drdreo,

Yeah it is normal you return to the "normal" state.

The steps are : normal state (without specific order) -> order by desc -> order by asc -> normal state...etc

@vsobolmaven
Copy link

Hi @drdreo,

Yeah it is normal you return to the "normal" state.

The steps are : normal state (without specific order) -> order by desc -> order by asc -> normal state...etc

Would be nice to have sort icon indicate that normal state. Currently, the icon by the column shows it is either ascending or descending only.

@vsobolmaven
Copy link

vsobolmaven commented Nov 2, 2018

The other issue with sorting behavior I encountered was that on-sort callback from paper-datatable-api is invoked when the data property is updated and what is strange the event.detail.sort parameter of the handler is reset to empty ({}). Is that something expected?

Here is a stack trace from a call when the data is set and it goes up to _handleSort.

  | _handleSort | @ | maven-md-table.js:149
-- | -- | -- | --
  | handler | @ | template-stamp.html:92
  | fire | @ | legacy-element-mixin.html:393
  | forEach | @ | paper-datatable-api.js:580
  | _sortChanged | @ | paper-datatable-api.js:570
  | runMethodEffect | @ | property-effects.html:818
  | runEffectsForProperty | @ | property-effects.html:162
  | runEffects | @ | property-effects.html:128
  | _propertiesChanged | @ | property-effects.html:1711
  | _flushProperties | @ | properties-changed.html:341
  | _flushProperties | @ | property-effects.html:1559
  | _invalidateProperties | @ | property-effects.html:1531
  | _setProperty | @ | property-effects.html:1516
  | Object.defineProperty.set | @ | properties-changed.html:150
  | _setColumns | @ | paper-datatable-api.js:483
  | flush | @ | flattened-nodes-observer.html:274
  | Polymer.Async.microTask.run | @ | flattened-nodes-observer.html:195
  | microtaskFlush | @ | async.html:31
  | characterData (async) |   |  
  | run | @ | async.html:190
  | _schedule | @ | flattened-nodes-observer.html:195
  | FlattenedNodesObserver | @ | flattened-nodes-observer.html:133
  | observeNodes | @ | polymer.dom.html:63
  | _dataChanged | @ | paper-datatable-api.js:245
  | runObserverEffect | @ | property-effects.html:217
  | runEffectsForProperty | @ | property-effects.html:162
  | runEffects | @ | property-effects.html:128
  | _propertiesChanged | @ | property-effects.html:1711
  | _flushProperties | @ | properties-changed.html:341
  | _flushProperties | @ | property-effects.html:1559
  | __enableOrFlushClients | @ | property-effects.html:1604
  | _flushClients | @ | property-effects.html:1579
  | _propertiesChanged | @ | property-effects.html:1707
  | _flushProperties | @ | properties-changed.html:341
  | _flushProperties | @ | property-effects.html:1559
  | _invalidateProperties | @ | property-effects.html:1531
  | set | @ | property-effects.html:1866

I am running Chromium 70.0.3538.77 and recent paper-datatable-api v2.0.18.
Thank you.

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

4 participants