Jul 23, 2010, 11:59 AM
[CLOSED] TreeGrid update
Hello,
I would want to do the following but it doesn't work as expected.
When I click a button a Ajax.request is sent to the server which returns a response in Json format. The response is in fact the content of my treegrid and I want to refresh the treeGrid with this response. I get the response correctly but unfortunately the treeGrid doesn't refresh.
As follow is the diffrent code I use:
The request is made with this ajax request
Here is the code of the action
Romuald.
I would want to do the following but it doesn't work as expected.
When I click a button a Ajax.request is sent to the server which returns a response in Json format. The response is in fact the content of my treegrid and I want to refresh the treeGrid with this response. I get the response correctly but unfortunately the treeGrid doesn't refresh.
As follow is the diffrent code I use:
The request is made with this ajax request
Ext.Ajax.request({
url: '<%= Url.Action("action", "controller") %>',
method: 'POST',
params: { data: data },
success: function(p1, p2) {
var nodes = eval(p1.responseText);
if(nodes.length > 0){
treeGrid.initChildren(nodes);
}
}
});
Here is the code of the action
[AcceptVerbs(HttpVerbs.Post)]
publicActionResult action(string data)
{
List<Dictionary<string, object>> dict = newList<Dictionary<string,object>>();
dict.Add(newDictionary<string, object>() { { "dateApproval", "tester" }, { "leaf", true } });
returnthis.Json(dict);
}
The TreeGrid is defined as follow<ext:TreeGridID="treeGrid"runat="server"Title="titre"
AutoScroll="true"Height="200">
<Columns>
<ext:TreeGridColumnDataIndex="dateApproval"Width="200"/>
</Columns>
</ext:TreeGrid>
What is going wrong in my code and what should be done the have the code behave as wished?Romuald.
Last edited by geoffrey.mcgill; Jul 26, 2010 at 6:55 AM.