如何填充koGrid组数组 [英] How to Populate koGrid Groups Array

查看:96
本文介绍了如何填充koGrid组数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个配置如下的koGrid:

I have a koGrid configured as follows:

        var myItemsGrid = {
            data: myItems,
            columnDefs: [
                { field: 'item.title', displayName: 'Title', cellTemplate: $("#cdfUrlCellTemplate").html() },
                { field: 'item.dueTimeUtc', displayName: 'Due', cellFormatter: formatDate, sortFn: sortDates },
                { field: 'id', displayName: 'Edit', cellTemplate: $("#editCellTemplate").html() }
            ],
            showGroupPanel: true,
            groups: ['item.title'],
            showFilter: false,
            canSelectRows: false

        };

我的问题是,我尝试使用网格中一个字段的字段名称填充的groups数组会导致以下错误:

My problem is that the groups array, which I have tried to populate using the field name of one of the fields in my grid, causes the following error:

TypeError:无法读取未定义的属性'isAggCol'

TypeError: Cannot read property 'isAggCol' of undefined

我应该如何填充groups数组,以便可以为网格设置初始分组?

How should I be populating the groups array so that I can set up initial grouping for my grid?

推荐答案

我最终不得不修补koGrid脚本,以使列的初始分组起作用.

I ended up having to patch the koGrid script to get the initial grouping of columns to work.

如果其他人有问题,我很乐意提供修补后的脚本.在经过一些调整之后,我将提出发出拉动请求以将修复程序放入koGrid存储库.

If anyone else has the problem I'm happy to provide the patched script. I will look at making a pull request to get the fix into the koGrid repository after putting it through its paces a bit more.

这篇关于如何填充koGrid组数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆