paper-datatable-api icon indicating copy to clipboard operation
paper-datatable-api copied to clipboard

Sort

Open papusa opened this issue 8 years ago • 5 comments
trafficstars

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

papusa avatar May 25 '17 09:05 papusa

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).

RoXuS avatar Jun 01 '17 14:06 RoXuS

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?

drdreo avatar Jun 16 '17 11:06 drdreo

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

RoXuS avatar Jun 16 '17 13:06 RoXuS

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 avatar Nov 02 '18 13:11 vsobolmaven

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.

vsobolmaven avatar Nov 02 '18 13:11 vsobolmaven