Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
[object Object] displayed on cell edit
posted

above image is how the data is and we have enabled cell editing. Now when we double click [object Object] is being displayed, how can we bind it with previous data and then update rather showing [object Object]

Parents Reply
  • 640
    Offline posted in reply to Satish Kumar

    Hello Satish,

    If the value that you are trying to edit is object, you should use an editor that can handle complex object. I believe you will find the Data Grid - Handling Complex Objects sample very helpful. There is demonstrated how you can use the igCombo control as an editor for columns with dataType "object":

    // dataSource for the combo editor
    var northWindCategoriesJSON = [
        { "ID": 0, "Name": "Food" },
        { "ID": 1, "Name": "Beverages" },
        { "ID": 2, "Name": "Electronics" }
    ];
    
    $("#grid").igGrid({
        ...
        columns: [
            ...
            {
                headerText: "Category", key: "Category", dataType: "object", mapper: function (record) {
                    return record.Category.Name;
                }
            }
        ],
        features: [
            ...
            {
                name: "Updating",
                editMode: "cell",
                columnSettings: [
                    {
                        columnKey: "Category",
                        editorType: "combo",
                        editorOptions: {
                            dataSource: northWindCategoriesJSON,
                            textKey: "Name",
                            valueKey: "ID",
                            mode: "dropdown"
                        }
                    }
                ]
            }
        ]
    });

    Additionally, here you can find more detailed information regarding how to handle complex data extraction from complex objects.

    Please let me know if you need any further assistance regarding this matter.

    Regards,
    Viktor Kombov
    Entry Level Software Developer
    Infragistics, Inc.

Children