43

I am trying to create custom Store, which should use WebSocket or REST (in case of WebSocket failure).

Code file rachet-store.js

It works almost perfectly. It works without problems with the REST also (myRest).

Problem is if the wsStore is used and If i delete a row on first or second page in the datagrid, the datagrid is notified and refresh itself. But if I delete a row on the third or any other page, the store is not refreshed.

I think the problem could be somewhere with the sort(), because using that how the Grid (or Pagination) works. (But its just a guess ...)

So, the question is, what did I do wrong?

jmeinlschmidt
  • 1,446
  • 2
  • 14
  • 33
Petr
  • 1,159
  • 10
  • 20
  • 3
    Can you host a functioning example somewhere ? It needs some debugging to be able to help you – ben Jul 25 '16 at 07:33
  • 2
    Unfortunatellly I cant. But I have craeted README on the github with install instructions. It is easy and quick :) – Petr Jul 25 '16 at 13:57
  • 2
    Maybe your guess is correct. But the pagination is a server side functionality where the delete event which triggers for all rows may not be bound to the records in third/ future page elements.. try to render the grid for every page navigation – AB Udhay Aug 02 '16 at 10:16
  • 2
    @ABUdhay This could help, but I'd like to know how to properly write dojo Store so It works well with datagrid. – Petr Aug 08 '16 at 08:46
  • 1
    Try sort function `this.inherited(arguments)` as `this.inherited("sort", arguments);` – bhantol Oct 27 '16 at 17:18

1 Answers1

1

dstore provides a flexible selection of stores out of the box, but sometimes, it is necessary to create a custom store to better suit the needs of an application. This is a tutorial for doing just that. For our example, we create a store around the GitHub API v3 for Gists.

http://dstorejs.io/tutorials/custom_stores.html

Anurag_Soni
  • 542
  • 2
  • 17