This is a migrated thread and some comments may be shown as answers.

[Solved] Refresh Multiple Details Grids

1 Answer 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
JDubs
Top achievements
Rank 1
JDubs asked on 28 Jun 2011, 09:55 AM
Hi,

I have a page that contains a grid with multiple detail views that are themselves grids.  

When a row from details grid A is deleted, I want to also refresh the contents of detail grid B.  Any ideas on how to do this?

Thanks.

1 Answer, 1 is accepted

Sort by
0
JDubs
Top achievements
Rank 1
answered on 28 Jun 2011, 10:59 AM
Managed to work this out:

Here's the code:

I added a .ClientEvents line into Grid A as follows:

     .ClientEvents(events => events.OnDataBound("Products_onDataBound"))

Then, created some JavaScript to issue a refresh request (as per the documentation!)

    function Products_onDataBound(e) {
        var source = e.target.id;

        var productClasses = source.replace("Products", "#ProductClasses");
        var classesGrid = $(productClasses).data('tGrid');
        classesGrid.ajaxRequest();


        var productCoordinates = source.replace("Products", "#ProductCoordinates");
        var productCoordinatesGrid = $(productCoordinates).data('tGrid');
        productCoordinatesGrid.ajaxRequest();
    }

If there's a better/cleaner solution, feel free to comment.
Tags
Grid
Asked by
JDubs
Top achievements
Rank 1
Answers by
JDubs
Top achievements
Rank 1
Share this question
or