edit

edit - fired when row or cell are put in edit mode. Passed arguments are:

  • e.row – the row which is in edit mode
  • e.cell – cell which is in edit mode. Applicable when cell editing is enabled
  • e.index – the zero-based index of the data item. Can be passed to the dataItem function to return the data item.
$("#grid1").shieldGrid({
    dataSource: {
        data: products,
        schema: {
            fields: {
                id: { path: "ProductID", type: Number},
                name: { path: "ProductName", type: String, nullable: false },
                quantity: { path: "SupplierID", type: Number },
                price: { path: "UnitPrice", type: Number },
                units: { path: "UnitsInStock", type: Number },
                discontinued: { path: "Discontinued", type: Boolean },
                myDate: { path: "d", type: Date }
            }
        }
    },
    events: {
        edit: function(e) {
            var row = e.row;
            var cell = e.cell;	
            alert("Edit event is fired");
        }    
    },
    rowHover: false,
    columns: [
        { field: "id" },
        { field: "name", width: "200px" },
        { field: "quantity" },
        { field: "price" },
        { field: "units" },
        { field: "discontinued" },
        { field: "myDate", format: "{0:MM/dd/yyyy}" }
    ],
    editing: {
        enabled: true,
        event: "doubleclick
        type: "cell",  
        confirmation: {
            "delete": {
                enabled: true,
                template: "Delete row {0}?" 
            }
        }
    }
});