Keno UI Grid With Angular and Batch Editing Issues

544 views Asked by At

I have a grid that is filled with data from the server when the controller is being initialized and the grid allow batch editing and i have a custom delete command that will mark the dataItem as MarkedAsDeleted. My requirements is:-

  1. If i update any row in the grid, the corresponding item in the angular dataSource didn't get updated. How to do this??
  2. If the user click the custom delete command , i want to mark the item to be MarkAsDeleted but i want that item to be hidden from the grid but still exists in the data source.
  3. I want to handle changes in the grid, so i can mark the corresponding item to be updated for example.

This is my code:-

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

and this is my html

<div kendo-grid="minorCategoriesGrid" k-options="vm.gridOptions">
                        </div>
1

There are 1 answers

0
Larry Popiel On

Bulk edit is currently not available for Kendo UI grid (Angular 2). I'm hoping that it will be available with the major release that has been announce for January 18th.