Merge two objects

2 posts, 0 answers
  1. Yatish
    Yatish avatar
    7 posts
    Member since:
    Apr 2016

    Posted 27 Sep 2016 Link to this post


    I am have two grid and need to merge the data from the two grids. I get the datasource for each of the grid, but I am not sure how to merge the data. (I have tried push method on the observablearray but failed to merge the objects).

                var items1= $;
                var items2= $;
                var mergedItems= items1.push(items2);


    Anyway to accomplish this?

    Thank you


  2. Stefan
    Stefan avatar
    1141 posts

    Posted 28 Sep 2016 Link to this post

    Hello Yatish,

    I can assume the desired result is one of the following two:

    1) To merge the two arrays into one array. If this is the desired result, I can suggest using the merge method to merge the arrays into one.

    2) To merge the first object from array one with the first object from array two. If this is the requirement, I can suggest the extend method:

    Also, I made a Dojo example demonstrating both implementations:

    I hope this will help you to achieve the desired result.

    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Back to Top