Refresh Grid when datasource is updated using Angular JS

4 posts, 0 answers
  1. Preethi
    Preethi avatar
    2 posts
    Member since:
    Oct 2014

    Posted 11 Feb 2015 Link to this post

    I have created a data source like

    $scope.gridOptions = {
                    dataSource: {
                        data: someData                  
                    },
        sortable: false,
        pageable: false,
        columns: [
                      { field: "CarlineName", title: "Carline Name" },
                      { field: "Today", title: "Today" },
                      { field: "PrevDay", title: "Prev Day"  }                
                    ],
                   }
                }; 

    I have grid definition something like this

    <div id="retailSalesGrid" class="retailSalesGrid" data-kendo-grid data-k-options="gridOptions" data-k-ng-delay="gridOptions" data-k-rebind="gridOptions.selectable"></div>

    This is working fine and the grid seems to be working fine.  But, lets say someData changes, how do I refresh the grid to show the new data. Grid does not refresh. How do I refresh it from the angular code ?

    Please help !

  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2596 posts

    Posted 13 Feb 2015 Link to this post

    Hello Preethi,

    You can call the read() method of the DataSource in order to read the data again. It should be something like this:

    $scope.retailSalesGrid.dataSource.read();

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. HARSHA
    HARSHA avatar
    1 posts
    Member since:
    Jun 2016

    Posted 28 Jun 2016 in reply to Kiril Nikolov Link to this post

    Hi Kiril,

    Iam facing similar issue ,i tried the solution provided by you but still facing same issue(grid data is not getting refreshed)

    my datsource is like

                $scope.dealGridOptions = {
                                                dataSource: new kendo.data.DataSource({
                                                data: a,// a is dynamic data from database
                                                schema: {
                                                model: {
                                                fields: {
                                                criteria: { type: "string", editable: false },
                                                artifacts: {  type: "string", editable: false },
                                                available: { type: "string" },
                                                solutionCompleteness: { type: "string" },
                                                owner: { type: "string" },
                                                comments: { type: "string", editable: false }
                                            }
                                            }
                                            },

    grid definition is 

     <div id="retailSalesGrid" class="retailSalesGrid" data-kendo-grid data-k-options="dealGridOptions" data-k-ng-delay="gridOptions" data-k-rebind="gridOptions.selectable">

    Any help is highly appreciated...

     

    Thanks,

    Harsha
                     

     

  4. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2596 posts

    Posted 29 Jun 2016 Link to this post

    Hi,

    From the provided code is not really clear what might be causing the issue. This is why I would like to ask you to create a runnable sample and open a new support request and we will be happy to help.

    Regards,
    Kiril Nikolov
    Telerik
     
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
     
Back to Top