Adding multiple records to DataSource

1 posts, 0 answers
  1. Mr. Gravity
    Mr. Gravity avatar
    3 posts
    Member since:
    Mar 2012

    Posted 27 Nov 2012 Link to this post

    I have a situation where the data for the grid will be returned in batches of 1000 records. I need to poll for this data and update the grid. I've tried using dataSource.add() and passing in a bunch of items, but it only ever adds the first item. Am I going to need to add one item at a time to the dataSource or is there something I am missing?

    var myGrid = $('#grid').data('kendoGrid');
    myGrid.dataSource.add({
                        name: 'Name 2',
                        fileType: 'Microsoft Outlook Note',
                        pathName: '/Evidence 2/Something/Collection/'
                    },
                    {
                        name: 'Name 3',
                        fileType: 'Microsoft Word Document',
                        pathName: '/Evidence 3/Something/Collection/'
                    },
                    {
                        name: 'Name 4',
                        fileType: 'JPEG/JFIF Image',
                        pathName: '/Evidence 4/Something/Collection/'
                    },
                    {
                        name: 'Name 1',
                        fileType: 'Portable Document Format',
                        pathName: '/Evidence 1/Something/Collection/'
                    },
                    {
                        name: 'Name 2',
                        fileType: 'Microsoft Outlook Note',
                        pathName: '/Evidence 2/Something/Collection/'
                    },
                    {
                        name: 'Name 3',
                        fileType: 'Microsoft Word Document',
                        pathName: '/Evidence 3/Something/Collection/'
                    },
                    {
                        name: 'Name 4',
                        fileType: 'JPEG/JFIF Image',
                        pathName: '/Evidence 4/Something/Collection/'
                    },
                    {
                        name: 'Name 1',
                        fileType: 'Portable Document Format',
                        pathName: '/Evidence 1/Something/Collection/'
                    });
Back to Top