Hi Guys,
.kendoMenu({dataSource: menuItems}); menuItems is JSON from the controller.
In my C# code, I have the property as Text (capital 'T'), but KendoUI expects a small 't'. I don't want to have properties in my C# starting with small letters. How do I tell Kendo that it should look for 'Text' rather than 'text'?
Thanks,
Andrei
5 Answers, 1 is accepted
0
Hi Andrei,
You can use the schema parse method of kendo DataSource and transform the data object according to your needs.
If you are using MVC backed you can also consider changing the JSON options SerializerSettings acoording to your needs.
Hope this information will be helpful.
Regards,
Plamen
Progress Telerik
You can use the schema parse method of kendo DataSource and transform the data object according to your needs.
If you are using MVC backed you can also consider changing the JSON options SerializerSettings acoording to your needs.
Hope this information will be helpful.
Regards,
Plamen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which
deliver the business app essential building blocks - a grid component,
data visualization (charts) and form elements.
0

Andrei
Top achievements
Rank 1
answered on 05 Mar 2018, 09:49 AM
Completely and utterly confused after an hour of struggling with it. Reverting to jQuery.map() much easier and clearer. :(
0
Hello,
Thank you your feedback - yes indeed the example in the documentation is with pure for loop but it can also be used with jQuery map as here.
Regards,
Plamen
Progress Telerik
Thank you your feedback - yes indeed the example in the documentation is with pure for loop but it can also be used with jQuery map as here.
Regards,
Plamen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which
deliver the business app essential building blocks - a grid component,
data visualization (charts) and form elements.
0

Andrei
Top achievements
Rank 1
answered on 07 Mar 2018, 09:09 AM
broken link or my firewall is not allowing it.
0
Hello,
It is the same example with a bit different content of the parse function that uses jQuery map:
Regards,
Plamen
Progress Telerik
It is the same example with a bit different content of the parse function that uses jQuery map:
<
script
>
var dataSource = new kendo.data.DataSource({
transport: {
read: {
dataType: "jsonp"
}
},
schema: {
parse: function(response) {
return $.map(response, function (value){
return {
id: value.ProductID,
name: value.ProductName
};
});
}
}
});
dataSource.fetch(function(){
var data = dataSource.data();
var product = data[0];
console.log(product.name); // displays "Chai"
});
</
script
>
Regards,
Plamen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which
deliver the business app essential building blocks - a grid component,
data visualization (charts) and form elements.