Show cool things you have done with our products


Post by mats »

To reload, simply call crudManager.load() and all data will be refreshed.

Post by Maxim Gorkovsky »

I just tried this approach on our advanced example (4.x) and it works well (I'm not destroying stores).
onLocaleEstablished : function (lc) {
        var me      = this;
        me.currentLocale    = lc;
        me.createApp();
    },

    createApp : function () {
        var me = this;

        var crud = me.crudManager = new Gnt.examples.advanced.crud.CrudManager({
            taskStore : new Gnt.examples.advanced.store.Tasks({
                calendarManager : new Gnt.examples.advanced.store.Calendars()
            })
        });

        // Creating undo/redo manager
        var undo = me.undoManager = new Gnt.data.undoredo.Manager({
            transactionBoundary : 'timeout',
            stores              : [
                me.crudManager.getCalendarManager(),
                me.crudManager.getTaskStore(),
                me.crudManager.getResourceStore(),
                me.crudManager.getAssignmentStore(),
                me.crudManager.getDependencyStore()
            ]
        });


        me.mainView         = me.getMainViewportView().create({
            viewModel       : {
                type        : 'advanced-viewport',
                data        : {
                    crud                : crud,
                    undoManager         : undo,
                    taskStore           : crud.getTaskStore(),
                    calendarManager     : crud.getCalendarManager(),
                    currentLocale       : me.currentLocale,
                    availableLocales    : me.getLocalesStore()
                }
            },
            crudManager     : crud,
            undoManager     : undo,
            startDate       : me.startDate,
            endDate         : me.endDate
        });

    },

    destroyApp : function () {
        var me = this;

        me.mainView.destroy();
        me.crudManager.destroy();
        me.undoManager.destroy();
    }
Then I open example and try in console:
app = Gnt.examples.advanced.getApplication();

app.destroyApp();
app.createApp();
I tried quick drag/drop/resize, add constraint, didn't see any exceptions. Have you added any listeners somewhere?

Post by ohadts »

YES, THANK YOU !
Works perfectly !.

:D

Post Reply