Data Source cloning

2 posts, 0 answers
  1. Nilesh
    Nilesh avatar
    9 posts
    Member since:
    Jan 2013

    Posted 05 Aug 2015 Link to this post


    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
  2. Alexander Valchev
    Alexander Valchev avatar
    2887 posts

    Posted 07 Aug 2015 Link to this post

    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;
    var ds2 = new;

    I hope this approach will fit in your scenario.

    Alexander Valchev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top