Hi everyone,
I'm not very familiar with Kendo.
This is my first time using an array of arrays. I expected all the Arrays in the Array to be DataSource structures.
Instead, I had to write something like this:
var selected = new kendo.data.DataSource();
for ( var font of AP.page.selectedFonts ) {
var newRow = {
id: font.id,
font: font.font,
// I thought this array was automatically converted to a DataSource.
items: new kendo.data.DataSource( { data: font.items } )
};
selected.add( newRow );
}
viewModel.set( "selectedFonts", selected );
Is this the correct approach?
Many thanks
Hi Roberto,
Could you please provide mroe dtails about the scenario and the usage of the dataSource in your application. Are you using it for some of the Kendo components? I am asking you this as there are multiple components which will accepts the list of the items as an array. For example:
However, if you need the items list to be explicitly converted to a Kendo DataSource your approach is correct.
Looking forward to your reply.
Regards,
Neli
Hi Neli
I'm using it to create a master/detail UI.
I'm using it to create a master/detail.I thought I'd just define an array as a DataSource and all nested arrays would automatically be DataSources.
Thanks for the clarification.
Happy summer!