Passing Parameters make other parameters drop

3 posts, 1 answers
  1. Davin
    Davin avatar
    7 posts
    Member since:
    Feb 2013

    Posted 03 Jun 2013 Link to this post

    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. Answer
    Daniel
    Admin
    Daniel avatar
    2231 posts

    Posted 06 Jun 2013 Link to this post

    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!
  3. Davin
    Davin avatar
    7 posts
    Member since:
    Feb 2013

    Posted 11 Jun 2013 Link to this post

    Nice! Thanks Daniel!
Back to Top