0

I'm using kendo grid with angular 1.x, I fill the grid with new data according to user input. First data is set and works, second search does not update the table. Here is how I set the data source:

    $scope.search = function () {
        dataService.getData(searchQuery).then(function (res) {
            $scope.isLoading = false;
            if (res === false) {
                $scope.dataError = true;
            }else {
                $scope.dataError = false;
                $scope.noDataError = false;
                drawTable(res);
            }
        });
    }

function drawTable(res) {

    $scope.mainGridOptions = {
        dataSource: { data: res, pageSize: 10 },
        autoBind: true,
        height: 550,
        groupable: true,
        sortable: true,
        pageable: {
            refresh: true,
            pageSizes: true,
            buttonCount: 5,
            pageSizes: [5, 10, 50, 100, 'All']
        },
        columns: [{
            field: "ID",
            title: "id",
            width: 150
        }, {
            field: "ExtractedText",
            title: "text",
            width: 300
        }, {
            field: "DateTimeAppCreated",
            title: "date created",
            width: 200
        }]
    };
}
Alex
  • 1,982
  • 4
  • 37
  • 70

1 Answers1

0

Please go through this link:

$scope.mainGridOptions.datasource.transport.read();

How to call refresh() on a kendo-grid from an Angular controller?

Fateme Mirjalili
  • 762
  • 7
  • 16
Santosh Singh
  • 561
  • 2
  • 16