Robo for many stores in a larger application

Undo / Redo framework for Ext JS
Post Reply
User avatar
King_Aero
Premium Member
Premium Member
Posts: 42
Joined: Fri Jul 16, 2010 8:46 pm

Robo for many stores in a larger application

Post by King_Aero »

Hey Bryntum,

I really like robo beyond just using it for my schedulers. I'm considering how to use this in a large application with many stores. Based on how it is designed for most cases you would want one robo for each store depending on your views and what the user sees. For example, if I have a grid and a store, I would use one robo to redo/undo from the toolbar on the grid store. Makes sense.

In my case, I have an object that has a collection of stores used across multiple views. I do this for a variety of reasons, but here I can't really use one robo. The undo/redo's could happen to stores not in view. I guess in a nutshell, I'm asking that a feature be considered where I can specify which store to undo/redo as an option. That way I don't have tons of robos.

On the other hand, perhaps a one to one relationship is better for reasons I don't quite understand yet. What would be your approach?

User avatar
maximgb
Core Developer
Core Developer
Posts: 98
Joined: Tue May 27, 2014 10:46 pm

Re: Robo for many stores in a larger application

Post by maximgb »

Hello, King_Aero

Robo is designed to work with multiple stores out of the box. Robo.Manager::stores config supports a single store instance as well as an array of store instances. If your store set can be divided to independent subsets then I would use one Robo.Manager for each subset. In practice undo/redo is a complex task which might not be 100% error prone, so the less parts (read stores) are involved the better, but there's no need to use separate Robo.Manager instance for each store neither.
Use the force read the source.

Post Reply