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.
Syncfusion Feedback

adding dynamic data into tree grid

Thread ID:

Created:

Updated:

Platform:

Replies:

125160 Jul 26,2016 02:38 PM UTC Jul 27,2016 03:44 PM UTC JavaScript 1
loading
Tags: ejTreeGrid
pramod
Asked On July 26, 2016 02:38 PM UTC

Scenario : add new blank row below selected row, then I enter some data into blank row.
Issue : I am getting blank data from above newly added row by using args.model.selectedItem.

sample code :

$("#TreeGridContainer").ejTreeGrid({
        dataSource: productArray,
        childMapping: "children",
        treeColumnIndex: 1,
        isResponsive: true,
        showColumnChooser: true,
        allowSorting: true,
        editSettings: {
            allowAdding: true,
            allowEditing: true,
            allowDeleting: true,
            editMode: "rowEditing",
            rowPosition: "belowSelectedRow"
        },
        columns: [
{ field: "Name", headerText: "Name" },
{ field: "Description", headerText: "Description" }
        ],
        toolbarSettings: {
            showToolbar: true,
            toolbarItems: [
                ej.TreeGrid.ToolbarItems.Add,
                ej.TreeGrid.ToolbarItems.Edit,
                ej.TreeGrid.ToolbarItems.Delete,
                ej.TreeGrid.ToolbarItems.Update,
                ej.TreeGrid.ToolbarItems.Cancel,
                ej.TreeGrid.ToolbarItems.ExpandAll,
                ej.TreeGrid.ToolbarItems.CollapseAll
            ]
        },
        //endEdit: function (args) {
        //    debugger
        //    if (args.columnName == 'Description')
        //        var data = args.data;
        //},
        toolbarClick: function (args) {

            if (args.itemName == 'Update') {

                debugger
                var treegridObj = $("#TreeGridContainer").data("ejTreeGrid");
                treegridObj._saveRow();
                if (args.model.selectedItem.level == 0) {
                    args.model.selectedItem['Id'] = args.model.currentViewData[args.model.currentViewData.length - 1].Id + 1;
                    args.model.selectedItem.children = [];
                }
                
                treegridObj.addRow(args.model.selectedItem, ej.TreeGrid.RowPosition.Child);
            }
        }
    })

Thanks and regards,
Pramod

Jonesherine Stephen [Syncfusion]
Replied On July 27, 2016 03:44 PM UTC

Hi Pramod, 
We regret for the inconvenience caused. 
We have analysed the reported issue with our sample. We are unable to reproduce the issue. Can you please revert us by modifying the sample based on your application along with the replication procedure? This would be helpful for us to serve you. 
Please let us know if you need more information 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.

Warning Icon 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.Close Icon

;