Is there any jsfiddle or documentation available on callback property on the fetch method on datasource or any other way of execute dom manipulation onloaded within the datasource object?
Thx
3 Answers, 1 is accepted
0
Nikolay Rusev
Telerik team
answered on 27 Feb 2012, 09:16 AM
Hello Erlend,
The callback of fetch method is a function that will be called when the DataSource completes with the data manipulation. It is essentially the same as to handle change event of the DataSource with the only difference that the callback will be called only once.
Regards,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
What I really was trying to achieve here was to set value(value) on a DOM ready dropdown after it had been given its datasource and list was ready based on a hidden value in the page.
When I used this method (fetch) then it seems that the dropdown list is not DOM ready as it fails on a .call(a,b) method.
I solved my issued with implementing a setTimeout callback to set the selected value in the dropdown list, however I don't see this as an ultimate solution.
I was thinking something like this:
<input id="hidden" value="1"/>
<input id="input"/>
var datasource = new kendo.data.dataSouce({...});
$("#input").kendoDropDownList({dataSource: datasource});
datasource.fetch(callback);
//Here i'm getting an error when I'm trying this.
function callback(){
$("#input").data("kendoDropDownList").value($("#hidden").val());
}
Is this expected or was this never to be achieved, or is there an other way to achieve this?