I am having a lot of trouble referencing a drop down list which does not have an ID but it has a data-container-for.
All i am trying to do is get the selected value in the dropdown list.
I have tried this which usually works when you have an ID.
var dd = $("#DashboardTypeId").data("kendoDropDownList");
any help would be appreciated
5 Answers, 1 is accepted
You can use the attribute equals jQuery selector, e.g.:
var
ddl = $(
'[data-container-for="custom-name"]'
).data(
'kendoDropDownList'
);
... to get a reference to the corresponding DropDownList, after the widget has been initialized, and then the the value() method:
http://docs.telerik.com/kendo-ui/api/javascript/ui/dropdownlist#methods-value
I have prepared a simple dojo to illustrate the described approach:
http://dojo.telerik.com/UwUje
I hope this helps.
Regards,
Dimiter Topalov
Telerik by Progress
Excellent I will give that a go. one way i found was to use an onchange function and intersect it then store the value in a var.
Hi I now have another issue with a data container and a kendo grid.
I am now trying to refresh the data in the container. I currently have an array which i pass to the kendo grids column attribute like so -
{ field: "RoleId", values: roleNames, title: "Role", id:"RoleId" }
Which works fine as long as i dont want to update roleNames but unfortunately i need to update the data. I am currently double clicking on the row and the data is populated into a kendo window, where i can change the data. one of the data fields is a drop down field with roleNames as the data.
Is there any way i can achieve this everything i have tried does not work apart from initialising the grid but then my double click doesn't work.-
$(tempUserhostDiv).delegate("tbody>tr", "dblclick", function ()
{
editSelectedUser();
});
all this function does is call the edit function. What happens when i double click the row it pops up but then goes away straight away. but if i manually call the edit function it stays.
Any help would be appreciated.
I tried to simulate the described scenario, but the Grid editing seems to work as expected on my end:
http://dojo.telerik.com/UMExo/2
Can you please compare the example above to your implementation, and apply the necessary adjustments. If the problem persists, please send us a similar isolated runnable project, where the issue can be observed, so we can inspect it further? Thank you in advance.
On a side note, please open a new thread for questions that are not related to the thread's original topic and scenario. This will facilitate a tidier support history of your account and better support service.
Regards,
Dimiter Topalov
Telerik by Progress