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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

125343 Aug 10,2016 01:08 AM Aug 11,2016 03:05 AM ASP.NET MVC 1
loading
Tags: TreeGrid
Lev Kadisov
Asked On August 10, 2016 01:08 AM

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

Jonesherine Stephen [Syncfusion]
Replied On August 11, 2016 03:05 AM

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   


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;