We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

TreeGrid: error in ej.treegrid.js with setted .IdMapping("Id") .ParentIdMapping("IdParent") when adding new row

Hi,

I have a editable TreeGrid version 14.2.0.26.
I can't add new row when I setted
        .IdMapping("Id")
        .ParentIdMapping("IdParent")
Exception in ej.treegrid.js in line 2935
           if (model.idMapping && model.parentIdMapping && !ej.isNullOrUndefined(data[proxy.model.parentIdMapping])) {
in _addRecord called from _startAdd with setted first parameter data = null.

    @(Html.EJ().TreeGrid("Editing")
        .Datasource(ds => ds.Json((IEnumerable<MyObject>)ViewBag.dataSource).UpdateURL("ObjectsUpdate").InsertURL("ObjectsInsert").RemoveURL("ObjectsDelete").Adaptor(AdaptorType.RemoteSaveAdaptor))
        .EnableResize()
        .ShowColumnChooser(true)
        .AllowSorting(true)
        .EditSettings(edit => {
            edit.AllowAdding().AllowDeleting().AllowEditing();
            edit.EditMode(TreeGridEditMode.CellEditing);
            edit.RowPosition(TreeGridRowPosition.Child);
        })
        .ToolbarSettings(toolbar =>
        {
            toolbar.ShowToolbar().ToolbarItems(new List<TreeGridToolBarItems>()
            {
                TreeGridToolBarItems.Add,
                TreeGridToolBarItems.Edit,
                TreeGridToolBarItems.Delete,
                TreeGridToolBarItems.Update,
                TreeGridToolBarItems.Cancel,
                TreeGridToolBarItems.ExpandAll,
                TreeGridToolBarItems.CollapseAll
            });
        })
        .IdMapping("Id")
        .ParentIdMapping("IdParent")
        .ChildMapping("Children")
        .TreeColumnIndex(1)
        .Locale("ru-RU")
        .Columns(col =>
        {
            col.Field("Id").HeaderText("ID объекта").AllowEditing(false).EditType(TreeGridEditingType.Numeric).Width(90).Add();
            col.Field("Name").HeaderText("Наименование").Width(270).EditType(TreeGridEditingType.String).Add();
            col.Field("IdParent").HeaderText("ID родительского объекта").AllowEditing(false).EditType(TreeGridEditingType.Numeric).Width(90).Add();
            col.Field("SortOrder").HeaderText("Порядок сортировки").EditType(TreeGridEditingType.Numeric).Width(90).Add();
        })
        .IsResponsive(true)
        .ClientSideEvents(eve => {
            eve.RowSelecting("rowSelecting");
            eve.EndEdit("endEdit");
        })

Lev

1 Reply

JS Jonesherine Stephen Syncfusion Team August 11, 2016 07:05 AM UTC

Hi Lev, 
Thanks for contacting Syncfusion support, 
The issue regarding “Console error during Toolbar add in self reference data source” has been fixed already and included in our Essential Studio 2016 Volume 2 Service Pack Release v14.2.0.28 which is available for download under the following link.  
 
Please let us know if you need further assistance on this.  
Regards,              
Jone sherine P S   


Loader.
Live Chat Icon For mobile
Up arrow icon