سؤال

I am working on an ASP.net MVC Application and using jqgrid in it. I wanted to do bulk edit for my grid.

I am aware that jqgrid support inline editing,cell editing and Popupform editing .

Is there any option that sets entire jqgrid in edit mode and after making changes , save them back to data base.

Please help.

هل كانت مفيدة؟

المحلول

You can use editRow option in loop in the loadComplete like,

$("#jQGrid").jqGrid({
    url: '../Controller/Action',
    datatype: "json",
    colNames: [...],
    colModel: [...],
     .
     .
     .
    gridview: true,
    loadonce: true,
    loadComplete: function () { 

        //just make all the row to editmode

        ids = $("#jQGrid").jqGrid('getDataIDs');
        var l = ids.length;
        for (var i = 0; i < l; i++) {
            $("#jQGrid").jqGrid('editRow', ids[i], true);
        }
    },
    rowNum: 10
});
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top