cascade example problem with javascript function

4 posts, 0 answers
  1. Daniel
    Daniel avatar
    192 posts
    Member since:
    Mar 2012

    Posted 13 Aug 2013 Link to this post

    Hello,
    i am using Vs2012,kendo 2013.1.154 version,
    and i want it to do the dropdown cascade example,and it gives me in firebug,that he doesn't know that javascript function put as filter
    the error message is : filterProducts is not defined
    here is my view
    <div class="demo-section">
        <h2>View Order Details</h2>
        <p>
            <label for="categories">Catergories:</label>
            @(Html.Kendo().DropDownList()
                  .Name("groups")
                  .HtmlAttributes(new { style = "width:300px" })
                  .OptionLabel("Select group...")
                  .DataTextField("Name")
                  .DataValueField("pkTallyGroup")
                  .DataSource(source => {
                       source.Read(read => {
                           read.Action("GetCascadeGroups", "Employees");
                       });
                  })
            )
        </p>
        <p>
            <label for="subgroups">Products:</label>
            @(Html.Kendo().DropDownList()
                  .Name("subgroups")
                  .HtmlAttributes(new { style = "width:300px" })
                  .OptionLabel("Select subgroup...")
                  .DataTextField("Name")
                  .DataValueField("pkTallySubGroup")
                  .DataSource(source => {
                      source.Read(read =>
                      {
                          read.Action("GetCascadeSubgroups", "Employees")
                              .Data("filterProducts");
                      })
                      .ServerFiltering(true);
                  })
                  .Enable(false)
                  .AutoBind(false)
                  .CascadeFrom("groups")
            )
            <script>
                function filterProducts() {
                    return {
                        groups: $("#groups").val()
                    };
                }
            </script>
        </p>
        
    </div>

    what should be the problem?or do i need to set something in VS2012 to see the scripts in the same page?
    Regards,
    Daniel
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 15 Aug 2013 Link to this post

    Hi Daniel,

     
    From the provided information it's not clear for us what is the exact reason for this behavior, however I notice that you are using unofficial version of KendoUI - could you please try to upgrade to the latest official release and let us know of the result? Also if you still receive this JS error please provide a runable example where the issue is reproduced - This would help us pinpoint the exact reason for this behavior.

    Kind Regards,
    Vladimir Iliev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Daniel
    Daniel avatar
    192 posts
    Member since:
    Mar 2012

    Posted 16 Aug 2013 Link to this post

    Sorry,unofficial version of kendoui?from where did you saw that?

    i used the online code example from kendoui.com but still i would like how can you know that is an unofficial version?!is something in my code,deprecated?obsolute?
    i would like to know for the future.regarding my problem,if i put it in the common.js a file fit common javascript functions,developed by my colegues,it seems that is working,so i wonder is some setting,from where the javascript functions are seen,in the whole project,kendoui require the javascript functions to be somewhere specific?


    Regards,
    Daniel
  5. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 16 Aug 2013 Link to this post

    Hi Daniel,

    In your first post you stated that you are using kendo 2013.1.154 version, however there is no official release of KendoUI with such version (most probably is internal build) - that why I suggested to upgrade to the latest official release (KendoUI v2013.2.716).

    Also it's not clear for me what you are asking in your second question - could you please clarify?

    Kind Regards,
    Vladimir Iliev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
UI for ASP.NET MVC is VS 2017 Ready