kendo grid delete command not working

前端 未结 5 1805
青春惊慌失措
青春惊慌失措 2020-12-31 04:57

i have developed a web application using kendo ui tools and theres a kendo grid with batch edit mode..

but when i press the delete

5条回答
  •  Happy的楠姐
    2020-12-31 05:08

    There are three common reasons delete won't work:


    1. Not setting editable of grid to inline or popup. The deleted items will be automatically processed through transport destroy only for "inline"/"popup" edit modes. Ex:

    editable: {
       mode: "inline",
    }
    //or
    editable: "inline"
    


    2. If on your datasource, you have the batch flag set to true, this means the datasource will make the call only after you tell it to, e.g calling sync(). Ex:

    var dataSource = new kendo.data.DataSource({
        batch: true,
        //.....
    });
    //... in some where e.g in a save button click event call the following line:
    dataSource.sync();
    


    3. You should define id to your primary key of database field name inside model of datasource. Ex:

       model: {
            id: "ProductID",
            fields: {
                ProductID: { editable: false, nullable: true },
            }
        }
    


    So the problem with your code is first one, i.e you did not set editable to inline or popup

提交回复
热议问题