如何阻止Kendo网格组功能进入服务器并在组内排序

时间:2018-10-09 16:14:53

标签: angularjs angular kendo-ui kendo-grid

大家好,我对Kendo网格分组有几个疑问:

这是我的配置:

   self.gridOptions = {
        autoBind: false,
        dataSource: {
            pageSize: 100,
            serverGrouping: false,
            serverPaging: true,
            serverSorting: true,
            transport: {
                read: loadDataSource,
                cache: false
            },
            group: [
            {
                field: "SugCheck"
            },
            {
                field: "KvutzaEZ", aggregates: [
                    { field: "KvutzaEZ", aggregate: "count" },
                    {
                        field: "Sky425SchumEZ", aggregate: "sum"
                    }
                ]
            }
            ],
            schema: {//data mapping in response
                data: "ResponseBody",
                total: "totalHeaders"
            }
        },
        pageable: {
            numeric: false,
            buttonCount: 0,
            pageSize: 100,
            messages: {
                empty: '',
                display: languageService.getActiveLanuage() === "en-gb" ? "{0}-{1}" : "{1}-{0}"
            }
        },
        dataBound: function (e) {
            // check for avaliable data (if no data found hide grid and show notification)
            var cheques = [];
            _.each(e.sender._data, function (element, index) {
                element.index = index;
                cheques.push(element);
            });
            skyOshMainService.setCheques(cheques);
            if (e.sender._data.length === 0) {

                self.isGridEmpty = true;
            }
            else {
                self.isGridEmpty = false;
            }
        },
        serverGrouping: false,
        scrollable: false,
        sortable: {
            mode: "single",
            allowUnsort: false
        },
        //sortable: false
        columns: [.....
        ]
    };
  1. 为什么每次我使用组功能时,kendo网格都会转到服务器?尽管我放入了配置servergrouping:false。

我使用了一个按钮,当单击“ make”时:

                self.gridObj.dataSource.group([
                    { field: "SugCheck" },
                    {
                        field: "KvutzaEZ", aggregates: [
                        { field: "KvutzaEZ", aggregate: "count" },
                        { field: "Sky425SchumEZ", aggregate: "sum" }
                        ]
                    }
                ]);

然后当我调试时,我看到它转到loadDataSource函数。 我可以在客户组中吗?

顺便说一句,我注意到在分组时顺序已更改。分组时如何确定排序顺序?

0 个答案:

没有答案