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

Passing Parameters make other parameters drop

2 Answers 60 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Davin
Top achievements
Rank 1
Davin asked on 03 Jun 2013, 10:26 PM
I am making a C# Razor MVC web app which uses kendo UI charts. I have 2 different chart setups on my index view.

3 of my charts pass a single parameter to a function called _GetAttrTop3 which then passes more parameters on to the controller. My 2 other charts don't send a parameter, but fires a function called _GetAttr() which sends parameters to the controller.

The problem is with the 3 charts that pass the parameter to the _GetAttrTop3 function. The parameter that gets passed to the function always gets passed along to the controller but there is always another parameter in that function that gets dropped.

Originally "Shift" was the parameter that wasn't passing, so I made it a session variable to fix the problem, but "Type" stopped getting passed, and now "LineName" isnt passing. So it seems that it always drops one parameter when I try to send it a parameter from one of the 3 WasteCategory#Charts. This is strange because the 2 other charts that dont send a parameter to their respective return function ( _GetAttr() ) work just fine.

attached is my _Layout.cshtml and my view called Index.cshtml

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 06 Jun 2013, 06:01 AM
Hello Davin,

You are executing the function instead of passing a reference or a function name. If you need to pass a parameter to the function then you could use the following approach:

.Data("function(){return _GetAttrTop3(1);}")
Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Davin
Top achievements
Rank 1
answered on 11 Jun 2013, 12:57 PM
Nice! Thanks Daniel!
Tags
Charts
Asked by
Davin
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Davin
Top achievements
Rank 1
Share this question
or