Vinit Patel
Vinit Patel

Reputation: 2464

How to access a javascript variable in kendo-UI function?

I have an issue with kendo-UI treeview and Ajax call. I have a dropdown and on dropdown change event I want to call an ajax, by this ajax call my treeview is refreshed and all data are changed. It means on dropdown change event call an ajax and update record of treeview.

code is :-

<script>
var id ;
$("drop").change()
{
   id = $("drop.selected").value();
}

$("treeview").kendoUI.Treevoew()
{
     //i want to use that id value in this function but i can't why?
});
</script>

I use jquery 1.10.2.Please suggest me how can i achive this functionality.

Thank you all

Regards,

vinit

Upvotes: 0

Views: 524

Answers (1)

Matt Millican
Matt Millican

Reputation: 4054

I believe to get the value from a Kendo drop down, you have to do this:

id = $('#mydropdown').data('kendoDropDownList').value();

Upvotes: 1

Related Questions