How to clear stores with CrudManager

Discuss issues related to v5.x
Post Reply
User avatar
Arno Voerman
Premium Member
Premium Member
Posts: 173
Joined: Thu Nov 21, 2013 7:42 am

How to clear stores with CrudManager

Post by Arno Voerman »

I'm loading taks and dependencies by the help of the crud manager. This works fine.

In my app the user can easily switch from one project to an other and after the switch the crudmanager reloads the stores again by the simple statement; cm.load().

But in some cases, no tasks and dependencies are available yet, so the server returns something like:

Code: Select all

{"requestId":1531043506852,"success":true,"store1":{"rows":null,"total":0},"store2":{"rows":null,"total":0}}
When the serer returns no data like above the 'old' tasks and dependencies are not cleared.
How can I clear the old dat in the CRUD-manages (-stores)?

regards,

Arno

User avatar
arcady
Core Developer
Core Developer
Posts: 2332
Joined: Wed Mar 20, 2013 6:57 am

Re: How to clear stores with CrudManager

Post by arcady »

I think providing empty arrays should work:

Code: Select all

{
    "requestId":1531043506852,
    "success":true,
    "store1":{"rows": [], "total":0},
    "store2":{"rows": [], "total":0}
}

User avatar
Arno Voerman
Premium Member
Premium Member
Posts: 173
Joined: Thu Nov 21, 2013 7:42 am

Re: How to clear stores with CrudManager

Post by Arno Voerman »

Yep. That solved the problem.

Thanks.

User avatar
Arno Voerman
Premium Member
Premium Member
Posts: 173
Joined: Thu Nov 21, 2013 7:42 am

Re: How to clear stores with CrudManager

Post by Arno Voerman »

May I suggest to extend the functionality in the next release to also clear the stores when rows: null is returned? This keeps the SQL-queries simpler.

User avatar
arcady
Core Developer
Core Developer
Posts: 2332
Joined: Wed Mar 20, 2013 6:57 am

Re: How to clear stores with CrudManager

Post by arcady »

Sure, why not. Here is a ticket for the feature: https://app.assembla.com/spaces/bryntum ... on/details

User avatar
Arno Voerman
Premium Member
Premium Member
Posts: 173
Joined: Thu Nov 21, 2013 7:42 am

Re: How to clear stores with CrudManager

Post by Arno Voerman »

thx.

Post Reply