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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Hierarchy Grid and DataSources

Thread ID:

Created:

Updated:

Platform:

Replies:

118488 Mar 12,2015 02:15 PM UTC Mar 13,2015 11:02 AM UTC ASP.NET MVC 1
loading
Tags: Grid
Andrea Perazzolo
Asked On March 12, 2015 02:15 PM UTC

HI,
just a question regarding the HIerarchy Grid and DataSources.
I need to reload dinamically the data binded on a sub level of my Hierarchical Grid, on demand.
Where in the Model can I change the sublevel Data and change them (possibly without reloading the Grid and Refreshing COntant that cloases all the levels opened?
When I open a Details Row, it's datasource contains only the data associated with that portion of the grid, and not the Entire Level Data that is defined on the ChildGrid MVC Helper.

I make an example: When I edit some values on a fourth level of my grid I need to recalculate the values present on the second.
i can change directly the json data loaded on the datasource or reload the data from the server and set as datasource of the second level

   Thanks in advance

    Andrea Perazzolo

Alan Sangeeth S [Syncfusion]
Replied On March 13, 2015 11:02 AM UTC

Hi Andrea,

Thanks for using Syncfusion Products.

We are glad to let you know that your requirement(“While editing in child grid update parent record also without collapsing the child Grid”) can be achieved by updating the parent Grid record using “updateRecord” Grid method in the “endEdit” event of child Grid. Please refer the following code snippets

@(Html.EJ().Grid<object>("HierarchyGrid")

....

.ChildGrid(child =>

        { ...

.ClientSideEvents(eve => eve.EndEdit("edit"));

    })

        )

function edit(args) {

        var obj = $("#HierarchyGrid").ejGrid("instance")

        var tr = this.element.closest("tr").prev("tr");

        var index = obj.getIndexByRow(tr);

        var rec = obj.model.currentViewData[index]

      

        this.refreshContent();

        var count = this.model.dataSource.filter(function (e) { if (e.Verified && e.EmployeeID == args.data.EmployeeID) return e }).length;

        rec.TrueCount = count;

        obj.updateRecord("EmployeeID", rec);

    }

For your convenience we have created a sample and the same can be downloaded from below link.

Sample: http://www.syncfusion.com/downloads/support/directtrac/118488/EJGrid1444397340.zip

In the above sample, in parent Grid we have a column that holds the count of true values in child Grid Column. When we edit the Boolean column in Child Grid we have updated the parent Record.

Also while creating the sample we faced issues “On updating Parent Grid record, its expand icon changes to Collapse icon” & “Total record count issue with updating record in child record”. We have logged defect report for this issue. A support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

But as workaround we have resolve this issue in the above sample by manually changing the collapse icon to expand and calling “refreshContent” Method. Please refer the following code snippets.

function edit(args) {

this.refreshContent();

        obj.updateRecord("EmployeeID", rec); // To resolve total record issue in child Grid

        tr = this.element.closest("tr").prev("tr");

        tr.find(".e-detailrowcollapse").attr("class", "e-detailrowexpand");

        tr.find(".e-gnextforward").attr("class", "e-icon e-gdiagonalnext");

    }

Please let us know if you need any further assistance.

Regards,
Alan Sangeeth 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

;