【问题标题】:Kendo Grid not refreshing after new data source is set设置新数据源后剑道网格不刷新
【发布时间】:2018-03-08 13:41:01
【问题描述】:

我使用kendo gridangular 1.x,我根据用户输入用新数据填充网格。第一个数据已设置并有效,第二个搜索不更新表。以下是我设置数据源的方式:

    $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
        }]
    };
}

【问题讨论】:

    标签: angularjs kendo-ui kendo-grid


    【解决方案1】:

    请通过此链接:

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

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

    【讨论】:

    • 你能解释一下你的答案吗?
    猜你喜欢
    • 1970-01-01
    • 2016-08-18
    • 2017-02-24
    • 1970-01-01
    • 2015-10-19
    • 2013-08-29
    • 2015-05-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多