PDA

View Full Version : [CLOSED] MVC Ajax - update a grid



adelaney
Jun 21, 2012, 5:24 PM
I have a grid on a page which load and has proxy calls of its own - which work. However, I additionally have part of the page which has a standard, MVC Ajax form, which calls a controller that produces a StoreResult - that works too. Now what I want to do is have the returned result update the grid by "syncing" the grid display to the new store data. How can I do this, or how should I do this?

geoffrey.mcgill
Jun 21, 2012, 9:37 PM
Hi,

Can you just re-bind the Data to the Store?

adelaney
Jun 22, 2012, 4:34 AM
I sort of stumbled upon a way that works:


function onFilterSuccess(ajaxContext) {
var data = ajaxContext.get_data();
App.queueStore.loadData(Ext.JSON.decode(data).data );
}


I don't know if this is the way I should do it, but it does work.

Daniil
Jun 22, 2012, 10:44 AM
Hi,

Well, the loadData method is often helpful. But I can't say it's the best in your case, because I have not understand the requirement well.

Can't you load the data from that controller action via the Store load method?

Example

grid.getStore().load({
url : "/Test/AnotherController"
});