getCustomEditorValue

getCustomEditorValue - Fires when the grid needs the custom editor value in order to update a field. This event is used when editing with custom column editor is used into the grid.

The data field name will be provided in the field property of that event.

The resulting value of the editor needs to be assigned to the value property of the event.

$("#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 }
            }
        }
    },
    rowHover: false,
    columns: [
        { field: "id" },
        { field: "name", width: "200px" },
        { field: "quantity" },
        { field: "price", editor: myCustomEditor },
        { field: "units" },
        { field: "discontinued" },
        { field: "myDate", format: "{0:MM/dd/yyyy}" }
    ],
    events: {
        getCustomEditorValue: function (e) {
            e.value = $("#test").swidget().value();
            $("#test").swidget().destroy();
        }
    },
    editing: {
        enabled: true,
        event: "doubleclick",
        type: "cell"
    }
});
function myCustomEditor(cell, item) {
    $('<div id="test"/>')
        .appendTo(cell)
        .shieldDropDown({
            dataSource: {
                data: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
            },
            value: !item["price"] ? null : item["price"].toString()
        }).swidget().focus();
}