具有角度和批量编辑问题的Keno UI网格

时间:2016-12-26 16:04:16

标签: angularjs typescript kendo-ui kendo-ui-grid

当初始化控制器并且网格允许批量编辑并且我有一个自定义删除命令将dataItem标记为 MarkedAsDeleted 时,我有一个填充了服务器数据的网格。我的要求是: -

  1. 如果我更新网格中的任何行,则角度dataSource中的相应项目不会更新。怎么做??
  2. 如果用户单击自定义删除命令,我想将项目标记为MarkAsDeleted但我希望该项目从网格中隐藏但仍存在于数据源中。
  3. 我想处理网格中的更改,因此我可以将相应的项目标记为更新,例如。
  4. 这是我的代码: -

    var chart = new Highcharts.Chart({
    
        chart: {
            defaultSeriesType: 'spline',
            renderTo: 'container'
        },
    
        xAxis: {
            categories: ['09:00', '10:00', '11:00', '12:00', '13:00']
        },
    
        series: [{
            data: [29.9, 106.4, 129.2, 102,null],
        }]
    
    });
    

    这是我的HTML

                            var dataSource = new kendo.data.DataSource({
                            data: this.jobCategory.minorCategories,
                            batch: true,
                            schema: {
                                model: {
                                    id: "id",
                                    fields: {
                                        id: { editable: false, nullable: true },
                                        name: { type: "string", validation: { required: true, pattern: '.{3,200}' } },
                                        notes: { type: "string" }
                                    }
                                }
                            }
                        });
    
                        this.gridOptions = {
                            toolbar: [{ name: "create", text: "Add a new minor category" }],
                            dataSource: dataSource,
                            autoBind: true,
                            height: 300,
                            editable: true,
                            sortable: true,
                            columns: [
                                {
                                    field: "name",
                                    title: "Name"
                                }, {
                                    field: "notes",
                                    title: "Notes"
                                },
                                {
                                    command: [
                                        {
                                            text: "",
                                            template: '<span class="k-button-icontext" ng-click="vm.test(dataItem)">Delete</span>'
                                        }
                                    ]
                                }
                            ]
                        };
    
    test(dataItem): void {
            dataItem.markAsDeleted = true;
        }
    

1 个答案:

答案 0 :(得分:0)

批量修改目前不适用于Kendo UI网格(Angular 2)。我希望它将在1月18日宣布的主要版本中提供。