This is a migrated thread and some comments may be shown as answers.

Refresh Grid when datasource is updated using Angular JS

3 Answers 1671 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Preethi
Top achievements
Rank 1
Preethi asked on 11 Feb 2015, 03:12 PM
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 !

3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 13 Feb 2015, 10:00 AM

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!
 
0
HARSHA
Top achievements
Rank 1
answered on 28 Jun 2016, 01:41 PM

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
                 

 

0
Kiril Nikolov
Telerik team
answered on 29 Jun 2016, 07:11 AM
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.
 
Tags
Grid
Asked by
Preethi
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
HARSHA
Top achievements
Rank 1
Share this question
or