Reputation: 19986
I'm using kendoWindow in Kendo UI for adding an element to my data table in Kendo UI. I'm using dropdownlist for selecting the user role from a set of user roles inside it. But when I use dropdownlist inside a Kendo UI kendoWindow, I'm getting it as a textbox instead of dropdownlist. But when I use the same dropdownlist outside the popup windo it works as if I expected. What is to be done in order to obtain the dropdown list inside kendoWindow?
I have attached the code here with.
In html page.
<div id="AddUserPopupTemplate">
<form class="form-horizontal custom-form" role="form">
<div class="row">
<input data-option-label=" " data-value-primitive="true" data-role="dropdownlist" data-text-field="UserRole" data-value-field="RoleId" data-bind="source: UserRoleSelected" />
</div>
</form>
</div>
Inside the controller.
AddNewUser: function () {
var myWindow = $("#AddUserPopupTemplate");
myWindow.kendoWindow({
width: "800px",
title: "Add User",
visible: false,
actions: [
"Pin",
"Minimize",
"Maximize",
"Close"
],
close: onClose
}).data("kendoWindow").center().open();
function onClose() {
}
$(document).ready(function () {
myWindow.data("kendoWindow").open();
});
}
Upvotes: 0
Views: 2361
Reputation: 21465
As you're using data attribute initialization, you need to force kendo to initialize it in the window's open
event with kendo.init()
:
open: function() {
kendo.init(myWindow);
}
More here: The Difference Between kendo.bind And kendo.init.
Upvotes: 1