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

cascade example problem with javascript function

3 Answers 112 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 13 Aug 2013, 07:06 AM
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

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 15 Aug 2013, 06:26 AM
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!
0
Daniel
Top achievements
Rank 1
answered on 16 Aug 2013, 06:41 AM
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
0
Vladimir Iliev
Telerik team
answered on 16 Aug 2013, 08:30 AM
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!
Tags
DropDownList
Asked by
Daniel
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or