Maximus
Maximus

Reputation: 164

how to dynamically set store dojo dgrid?

I want to set the store dynamically in a dGrid when I call a function and not when I declare. Is it possible? In dataGrid I use

   gridId.setStore(newStore);

Is there something similar to it for dGrid in dojo?

I went through all the api's and documentation but still no result.

Upvotes: 0

Views: 2082

Answers (1)

Ken Franqueiro
Ken Franqueiro

Reputation: 10559

dgrid follows the same pattern as Dijit of having central set and get methods rather than separate public setFoo and getFoo methods to call for every property. So instead of setStore(newStore), you call set('store', newStore). (In contrast, dojox DataGrid's APIs follow a pattern that has been deprecated since Dojo 1.4.)

This is covered in dgrid's documentation as well as in the Grids and Stores tutorial.

Upvotes: 2

Related Questions