Oct 16, 2013, 4:04 PM
How to get a treepanel node selection to run an Ajax request
I have a chart that I can reuse for different kind of data. I created a treepanel from the Simple example in which I display selections that can determine how the chart is going to display the data. This is the setup:
The chart has the following Proxy:
TreePanel
------ ITem 1 NodeID=1
------Item 2 NodeID = 2
I want to select the item from tree and dynamically change the url of the chart and reload the chart with the new data. The problem that I am having is how to dynamically change the chart url from the tree selection. I would want something like:
The chart has the following Proxy:
.Proxy(
Html.X().AjaxProxy()
.Url(Url.Action("GetChartData", new { id = 1 }))
.ActionMethods(actions =>
{
actions.Read = HttpMethod.POST;
})
.Reader(
Html.X().JsonReader().Root("result")
)
The treepanel has the NodeID of each leaf setup to a number. SoTreePanel
------ ITem 1 NodeID=1
------Item 2 NodeID = 2
I want to select the item from tree and dynamically change the url of the chart and reload the chart with the new data. The problem that I am having is how to dynamically change the chart url from the tree selection. I would want something like:
.Url(Url.Action("GetChartData", new { id = TreePanle.NodeID }))
Last edited by Daniil; Oct 17, 2013 at 5:48 AM.
Reason: Please use [CODE] tags