We are using the single local DataSource at many places so we want to clone the DataSource. Please suggest the best way to clone
the dataSource.
Best Regards,
Nilesh Padbidri
1 Answer, 1 is accepted
0
Alexander Valchev
Telerik team
answered on 07 Aug 2015, 09:09 AM
Hello Nilesh,
The dataSource does not have a clone method. Instead you may store the dataSource configuration in an object and use it every time when you want to build new instance.
var dataSourceConfig = {
data: [{foo: "bar"}],
pageSize: 3,
/* etc... */
};
var ds1 = new kendo.data.DataSource(dataSourceConfig);
var ds2 = new kendo.data.DataSource(dataSourceConfig);
I hope this approach will fit in your scenario.
Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!