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

[Solved] Get reference to detailview from JQuery

1 Answer 30 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.
calvin
Top achievements
Rank 1
calvin asked on 25 Jan 2011, 02:02 AM
Hi,
I would like to know how to get a reference to a detailview grid from JQuery to be able to rebind only the detailview of the master-detail grid.

Scenario:
- I have a Submit button in a client template on one of the columns of detailview. Submit button calls a JQuery function to perform an Ajax post to update the status of the row (eg., Submitted, Rejected etc.,).  I would like to rebind only the detailview after the post.

Reference to master grid works ok to rebind it - but that would rebind the entire grid (which includes all detailviews). I would like to know the equivalent of the below for detailview rebind. Please help.

 

 

var grid = $('#DocumentsGrid').data('tGrid');

 

 

 

if (grid != null) {

 

grid.rebind();

}

Thanks,
Calvin

1 Answer, 1 is accepted

Sort by
0
calvin
Top achievements
Rank 1
answered on 04 Feb 2011, 08:42 AM
Found the answer myself.

var detailsViewGridId = '#' + $('#UniqueIdOfDetailsView).val();
var detailsViewgrid = $(detailsViewGridId).data('tGrid');

if (detailsViewgrid != null) {
detailsViewgrid.rebind();
}

 

Tags
Grid
Asked by
calvin
Top achievements
Rank 1
Answers by
calvin
Top achievements
Rank 1
Share this question
or