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
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
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
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
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
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
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.