Hello, the following code works like a charm:
var arr = [ {text:"Option 11",value:"Value 11"}, {text:"Option 22",value:"Value 22"} ]; arr.push({text:"Option 33",value:"Value 33"}); var datasource = new kendo.data.DataSource({ data: arr }); datasource.read(); jQuery("#operation").data("kendoDropDownList").setDataSource(datasource);
However if I try this:
var arr = [ {text:"Option 11",value:"Value 11"}, {text:"Option 22",value:"Value 22"} ]; for(i=0;i<operators.length;i++) { var singleElement = { text:operators[i], value:operators[i] }; arr.push(singleElement); } var datasource = new kendo.data.DataSource({ data: arr }); datasource.read(); jQuery("#operation").data("kendoDropDownList").setDataSource(datasource);
I get [object Object] where I should have the elements
of operators as values and text on the dropdownlist.
If I try this:
var arr = [ {text:"Option 11",value:"Value 11"}, {text:"Option 22",value:"Value 22"} ]; for(i=0;i<operators.length;i++) { var singleElement = "{text:\""+operators[i]+",value:\""+operators[i]+"\"}"; arr.push(singleElement); } var datasource = new kendo.data.DataSource({ data: arr }); datasource.read(); jQuery("#operation").data("kendoDropDownList").setDataSource(datasource);
I get "undefined" where I should have the elements
of operators as values and text on the dropdownlist.
Any idea on how can get the values from "operators" into the datasource and show up on the dropdownlist ?
Thanks,
Rafael
Download kendo ui trial and in exmaple i just try following code
place these two file at "Kendo 2023\examples\dropdownlist" and run you will find "Blocked a frame with origin "null" from accessing a cross-origin frame."
parent.html is as below
<html lang="en">
<head>
<title>Parent Frame</title>
<script>
___data = [
{ CityID: 1, CityName: "Lisboa" },
{ CityID: 2, CityName: "Moscow" },
{ CityID: 3, CityName: "Napoli" },
{ CityID: 4, CityName: "Tokyo" },
{ CityID: 5, CityName: "Oslo" },
{ CityID: 6, CityName: "PŠ°ris" },
{ CityID: 7, CityName: "Porto" },
{ CityID: 8, CityName: "Rome" },
{ CityID: 9, CityName: "Berlin" },
{ CityID: 10, CityName: "Nice" },
{ CityID: 11, CityName: "New York" },
{ CityID: 12, CityName: "Sao Paulo" },
{ CityID: 13, CityName: "Rio De Janeiro" },
{ CityID: 14, CityName: "Venice" },
{ CityID: 15, CityName: "Los Angeles" },
{ CityID: 16, CityName: "Madrid" },
{ CityID: 17, CityName: "Barcelona" },
{ CityID: 18, CityName: "Prague" },
{ CityID: 19, CityName: "Mexico City" },
{ CityID: 20, CityName: "Buenos Aires" }
]
</script>
</head>
<body>
<iframe src="./child.html" style="height: 100vh;width: 100vw;border: 0;"></iframe>
</body>
</html>
and child.html is as below
<!DOCTYPE html>
https://dojo.telerik.com/ezOJuzog
I have a kendo dropdownlist with virtualization that uses a local json object (the real list is longer than my example). When I set the value and immediately try to log that new value out, I get nothing. How do I log out the value after setting it when using virtualization? Here is a dojo example where you will see it logs "The value is now:" with no answer. If I remove virtualization it logs the answer out.
I was trying to implement Kendodropdowntree , I came across following situation which I am not able to understand
$(dropdowntree).kendoDropDownTree({
placeholder: "Select ...",
height: "auto",
dataSource: //HARD CODED VALUE GOES HERE
});
}
Above example will work fine when , I hard code those datasource values. When I try to pass some variable there it will not work
var datatobind= somedata // data in exact format it is expected
{
$(dropdowntree).kendoDropDownTree({
placeholder: "Select ...",
height: "auto",
dataSource: datatobind
});
}
Even I tried passing variable of following type
var dataSourcetype = new kendo.data.HierarchicalDataSource({
data: datatobind
});
{
$(dropdowntree).kendoDropDownTree({
placeholder: "Select ...",
height: "auto",
dataSource: dataSourcetype.options.data
});
}
But even above also doesn't solve problem, I am not able to get it , why passing exact same variable is not binding to data source.
I'm new to Kendo UI/Telerik, but have been a web developer for over 15 years.
Please forgive my title as well, as I could be doing it completely wrong by doing this:
dataBound:function(){
$('.toolbar').kendoToolBar({
items: [ {
type: "splitButton",
text: "Edit",
click:function(e){
var grid = $('#grid').data('kendoGrid');
grid.editRow(e.target.parents('tr'))
},
menuButtons: [
{ id: "foo", text: "Print", click:function(){alert('print')} },
{ id: "bar", text: "Delete", click:function(e){
var grid = $('#grid').data('kendoGrid');
grid.removeRow(e.target.parents('tr'))
} },
]
} ]
});
}
But that's what the demo shows. Iām a bit confused as to why this works with a hardcoded data source:
https://dojo.telerik.com/eMUwAqUH
I've been piecing together quite a bit on my own, but one thing has me stumped -- this seems like such a common requirement for Grid usage, and yet my searches don't seem give me anything for jQuery UI.
But as soon as I swap in my real data source (API call), when I hit Edit, then hit Edit again to save the change, the entire box disappears.
I took a short video:
https://www.loom.com/share/9d894316b4364efbae18c01e8ede9db4
This is a pretty big deal for me because all of my data tables are going to be API driven, and I want to use a dropdown for the action columns NOT individual buttons. A lot of the time Iām going to have more than just āEdit and Deleteā so a dropdown makes more sense.
Any help would be appreciated, I'm sure you can literally swap out the dataSource and columns with a sample one, and you should get the exact same error. I'm running on the latest version of Edge, but same thing happens in Chrome.
Hey guys,
Here's the thing, I have a dropdownlist populated already (use datasource in case this info is needed, since the info comes from an endpoint) and it has to be this function so that the user types anything (on an input generated by the method "filter" )and the data gets filtered, but i want to do it at the client side so in that case i wouldn't have to change any c# code. So i found out there's this method "filtering" but i didn't found an example of how to apply it, so i'm here in looking for any guidance.
Hope you understand my doubt.
Regards.