This is a migrated thread and some comments may be shown as answers.

Update datasource using Controllers(MVC) and RoutedValues

1 Answer 118 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Erick
Top achievements
Rank 1
Erick asked on 28 Jan 2013, 10:19 AM
Hello.
When I define a Chart for the first time, I put the Action Name, Controller Name and Route Values:
.DataSource(datasource => datasource
.Read(read => read.Action("DataForEvo", "Home", new { seriename = "Default", category = "Default" }))
But later, I need to reload the chart with new 'route values':
I have 2 charts in the same page, at the bottom a "Bar Chart", and at the top a "Line Chart", when the user click any serie of the Bar Chart, the Line Chart should be updated with relative data.

In the "Bar Chart" I have the Series Click event:
 
.Events(ev => ev.SeriesClick("onSeriesClick")))

where I can capture the serie name, category and value. From here using jquery I can capture the chart
var Chart = $("#chart").data("kendoChart");

maybe exist a method or way to call again the action with new 'route values'.

Many Thanks.

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 30 Jan 2013, 01:31 PM
Hello Erick,

Basically in such case you should use the dataSource.read() method to perform new Ajax request. You can send additional parameters to the server either with the help of the data function or you can pass them directly to the method like this:

$('#theOtherChart').data().kendoChart.dataSource.read({ seriename : "someNewValue", category : "someOther" })


Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Charts
Asked by
Erick
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or