bluewatertracks / bwt-datatable

Data table with Polymer 3 support!
GNU General Public License v3.0
42 stars 14 forks source link

Sortable not working #46

Closed etanuvar closed 5 years ago

etanuvar commented 6 years ago

I have a problem with sorting in paper-datatable, event in your component are raising but nothing happens on view side. There is my code:

    <paper-datatable id="documentTypesTable" data="{{data.value}}" selectable response-width="767px" cell-tap="handleClick">
      <paper-datatable-column header="[[localize('documents-type-field-name')]]" property="Name" type="String" sortable>
      </paper-datatable-column>
      <paper-datatable-column header="[[localize('documents-type-field-description')]]" property="Comment" type="String">
      </paper-datatable-column>
      <paper-datatable-column header="[[localize('documents-type-field-created-at')]]" property="CreatedAt" type="Date">
      </paper-datatable-column>
      <paper-datatable-column header="[[localize('documents-type-field-created-by')]]" property="CreatedBy" type="String">
      </paper-datatable-column>
    </paper-datatable>
dhrytsenko commented 5 years ago

Hi @etanuvar and sorry for delay. Could you show me your implementation of methods for table as queryForIds/getByIds? I'll add more examples today. I hope it could be useful for you if you need it

dhrytsenko commented 5 years ago

@etanuvar please check this example https://github.com/bluewatertracks/bwt-datatable/blob/master/examples/your-datatable-implementation.js and open this issue again if you have more questions

gaxolio commented 4 years ago

Hi @dhrytsenko , I have the same problem of @etanuvar . Mi env is: polymer 3. (version 3.4.1) bwt-datatable 3.0.0. nodejs v.12.16.3 express v.4.17.1 I have seen your example but I don't need a paper-datatable-card. I use a simple table that I have to sort on a column. for example, I only have two lines that I want to order. Following the code to the function _internalSort on line 1088: this.set("_rowKeys", this._rowKeys); value of this._rowKeys are correctly sorted ascending or descending. ["#0", "#1"] or ["#1", "#0"] but the table is not updated. In the previous version the update worked. I have attached a piece of html code as an example. Thanks

datatable.txt