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

Cascading DropDownList not working in popup Window

8 Answers 292 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 2
Bob asked on 30 Dec 2016, 03:40 PM

I am not sure if this is a KendoWindow problem or a KendoDropDownList problem, so I will post in both forums.
My Problem:
I have 2 DropDownLists; 'Code' and 'Rule'. 'Rule' cascades from 'Code'. These are both located in a modal KendoWindow.
If I have my controller return a PartialView, the second DropDownList does not even appear as a DropDownList, but as a textbox (Image1.jpg).
If I return a regular view, then both of the DropDownLists appear as they should (Image2.jpg), but then I get all of the stuff on the top of the popup that I do not want or need.

Code for my first DropDownList:

@(Html.Kendo().DropDownListFor(model => model.IncidentCategoryCode)                 //DropDownList for CODE
.HtmlAttributes(new { id = "incidentCategoryCode", style = "width: 99%;", @class = "large-links" })
.DataTextField("IncidentCategoryCode")
.DataValueField("IncidentCategoryCode")
.DataSource(source =>
{
    source.Read(read =>
    {
        read.Action("GetIncidentCategories", "IncidentCategory");
    });
})
)

Code for my second DropDownList:

@(Html.Kendo().DropDownListFor(model => model.ViolationCategoryNumber)                 //DropDownList for RULE
.HtmlAttributes(new { id = "violationCategoryNumber", style = "width: 99%;", @class = "large-links" })
.DataTextField("ViolationCategoryNumber")
.DataValueField("ViolationCategoryNumber")
.DataSource(source =>
{
    source.Read(read =>
    {
        read.Action("GetIncidentViolations", "IncidentViolation").Data("filterCreateIncidentViolation");
    })
    .ServerFiltering(true);
})
.CascadeFrom("incidentCategoryCode")
.CascadeFromField("IncidentCategoryCode")
)

Code for my filter:

function filterCreateIncidentViolation() {
    return {
        code: $("#incidentCategoryCode").val(),
        incidentViolationCodeFilter: $("#violationCategoryNumber").data("kendoDropDownList").value()
    };
}

 

Any ideas on this would be greatly appreciated,

Bob Mathis

8 Answers, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 03 Jan 2017, 01:59 PM
Hello Bob,

Please find attached a sample project we prepared to recreate the described scenario. Unfortunately we were unable to observe the described behavior.

Would you please modify the attached project so that it better represents your case and reproduces the issue and send it back to us along with more detailed steps for reproducing it? Thus, we would be able to investigate locally and help you more efficiently.

Meanwhile, would you please check for any JavaScript errors in the browser's console that could prevent the proper behavior of the widgets? 

Regards,
Peter Milchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Bob
Top achievements
Rank 2
answered on 04 Jan 2017, 04:11 PM
I am going through your code trying to understand it so I can try to apply it to my project. I will let you know what I find.
However, I am not sure how to check for JavaScript errors on a popup window. Using the F12 tools, I can only see the Main Page that the window was called from.
Is there some trick to use to be able to troubleshoot the window?

Thanks,
Bob
0
Peter Milchev
Telerik team
answered on 06 Jan 2017, 01:21 PM
Hello Bob,

Take your time reviewing the project. 

As for your question, doesn't pressing F12 work when you focus the popup window? Also, here is a forum thread where debugging in a popup window is discussed: How to debug javascript as a popup window loads?

Regards,
Peter Milchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Bob
Top achievements
Rank 2
answered on 09 Jan 2017, 02:42 PM
Actually, neither one of these work. Either way, F12 ands up showing the page that called the popup and nowhere does it show the popup.
0
Peter Milchev
Telerik team
answered on 11 Jan 2017, 11:14 AM
Hello Bob,

Right clicking the popup window and selecting "Inspect"(Chrome) or "Inspect Element"(IE) should open the DevTools or F12 tools for the popup window. 

Regards,
Peter Milchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Bob
Top achievements
Rank 2
answered on 11 Jan 2017, 02:46 PM
Neither of those work for what I need to do. I need to examine the code in the popup window. Using either the IE or Chrome methods you described only brings up the code for the page that called the window and not the window itself.
0
Peter Milchev
Telerik team
answered on 13 Jan 2017, 12:14 PM
Hello Bob,

Here is a screencast that demonstrating how to check the content of the popup window, using "right click -> Inspect" in Chrome. It also shows how the console context is changed when different elements are inspected.

Regards,
Peter Milchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Bob
Top achievements
Rank 2
answered on 17 Jan 2017, 02:27 PM

That doesn't help either. Even in your screencast, you don't get to the JavaScript for the popup and I can't get to it when I try, either.
I guess I'm just going to have to put in a lot of "alerts" and "console.writes" and try to troubleshoot it that way.

Tags
DropDownList
Asked by
Bob
Top achievements
Rank 2
Answers by
Peter Milchev
Telerik team
Bob
Top achievements
Rank 2
Share this question
or