Just wondering if anyone can help me with this issue. I have a Gridx connected to a JSONRest store. It works but when the grid starts up it seems to make a call to my server. I dont want this to happen. The server call takes two parameters and i only want this to be called when i query the store.
my code:
var restStore = new
dojo.store.JsonRest({target: "search"});
grid = new Grid({
id: 'grid',
cacheClass: Cache,
store: restStore,
autoHeight:true,
pageSize: 10,
modules: [
Pagination,
PaginationBar
],
paginationBarSizes: [10, 25, 50],
paginationBarVisibleSteppers: 4,
paginationBarGotoButton: false,
paginationBarDescription: true,
structure: [
{id: "description", field: 'description', width: '100%',
formatter: formatter,
}
]
});
query to the store which works
grid.model.clearCache();
grid.store.query({term : term, category : category}).then(function(results){
});
Also if i have the gridx inside another widget, it gets called again when the other widget starts up.
Any body any ideas how i get around this?
Gridx takes a 'query' parameter in it's initialization arguments, which sets initial query for the store. gridx queries the store on startup to populate itself for the first time. just specify
in gridx initialization and it will perform that query for you on startup to populate your grid