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

MultiSelectDropDownList inside a Window

1 Answer 10 Views
Window
This is a migrated thread and some comments may be shown as answers.
PRASANTA
Top achievements
Rank 1
PRASANTA asked on 30 Jul 2015, 07:38 AM

Hello,

 Can you please help me for the following problem?

I have a Kendo Window. Now I have added one MultiSelectDropDownList inside the content like below.

@(Html.Kendo().Window()
    .Name("window")
    .Title("Add From Pool")
    .Draggable(false)
    .Modal(true)
    .Width(600)
    .Actions(actions => actions.Close())
    .Visible(false)
    .Events(e => e.Open("copyStructure_Open"))
    .Content(@<table>
        <tr>
            <td colspan="2">
                @(Html.Kendo().MultiSelect()
                  .Name("kMultiSelect")
                  .TagMode(TagMode.Single)
                  .DataTextField("Value")
                  .DataValueField("Key")
                  .Placeholder("Select Office")
                  .AutoBind(true)
                  .HtmlAttributes(new { style = "width:300px" })
                )
            </td>
        </tr>
        <tr>
            <td>
                @(Html.Kendo().Button()
                .Name("btnContinue")
                .Content("Continue"))
            </td>
            <td>
                @(Html.Kendo().Button()
                .Name("btnCancel")
                .Content("Cancel"))
            </td>
        </tr>
    </table>)
)

Now I want to bind the MultiSelectDropDownList each time when window opens using below mentioned Ajax Call.

function copyStructure_Open(e)
{
    $.ajax({
        url: 'Employee/GetEmployeesPool',
        type: 'POST',
        success: function (data) {
            e.sender.content(data);
        }
    });
}

But I am not getting the expected result.

Please help me as I am new to this Kendo UI.

Thanks

Prasanta

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 03 Aug 2015, 07:39 AM

Hello PRASANTA,

 

With the current provided implementation the entire content of the Window will be set to the returned result. 

 

As far as I understand you want to populate the MultiSelect DataSource with the result (returned data) from the ajax call. So I would suggest accessing the MultiSelect widget and respectively its data source. Using the data method will set the data items of the data source. 

 

 

Please refer to Obtain a Reference to a Kendo UI widget Instance Using jQuery article. 

 

 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Window
Asked by
PRASANTA
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or