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
2165
Disable edition/deletion/addition in child grids
posted

I want to disable addition, deletion, and edition in a hierarchical grid. This works fine for the first level of the grid:

$("#MyGrid").igGridUpdating("option", "enableAddRow", false);
$("#MyGrid").igGridUpdating("option", "enableDeleteRow", false);
$("#MyGrid").igGridUpdating("option", "editMode", "none");

but child rows still can be edited. How to disable that options en the second level even if the parent rows are not expanded?

Parents
  • 17590
    Offline posted

    Hello Luis,

    Thank you for posting in our community.

    By design igHierarchicakgrid is not editable until you enable the Updating feature. This means that if you do not enable Updating explicitly users are not going to be able to add, delete or edit rows in both parent and child levels.

    However, if you would like to disable editing from the Updating feature you could set the  the enableDeleteRow  and enableAddRow to false  and editMode to none. For example:

    $("#hierarchicalGrid").igHierarchicalGrid({

    width: "100%",

    dataSource: data,

    autoGenerateLayouts: false,

    autoGenerateColumns: false,

    columns: [

    {

    key: "Name",

    headerText: "Name",

    dataType: "string"

    }

    ],

    features: [

    {

    name: "Updating",

    editMode:"none",

    enableAddRow: false,

    enableDeleteRow: false,

    }

    ],

    defaultChildrenDataProperty: "Products",

    columnLayouts: [

    {

    name: "Products",

    childrenDataProperty: "Products",

    autoGenerateColumns: false,

    columns: [

    {

    key: "Quantity",

    headerText: "Quantity",

    dataType: "number"

    },

    {

    key: "Name",

    headerText: "Name",

    dataType: "string"

    }

    ],

    features: [

    {

    name: "Updating",

    editMode: "none",

    enableAddRow: false,

    enableDeleteRow: false,

    }

    ]

    }

    ]

     

    });

    I hope this will help you achieve your requirement.

    I also created a small sample illustrating my suggestion and I am attaching it for your reference.

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

    igHierarchicalGridDisableEditing.zip
Reply Children