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

[Solved] Ajax Binding, How to return additonal parameters

0 Answers 100 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.
sL342799
Top achievements
Rank 1
sL342799 asked on 06 May 2011, 03:18 AM
Hi Team!

I have a grid which uses server binding to initially populate. Once populated the user can click a link which calls a grid.rebind using javascript:

function showFilterRebind(qType) {
var activityGrid = $('#reportGrid').data('tGrid');
activityGrid.rebind({ queryType: qType});
 }

The javascript results in the Ajax Binding method being called on the controller which queries the database passing the query parameter and returns a GridModel object via:

[GridAction]
public ActionResult _AjaxBindingActivityReport(string queryType)
{
return
View(new GridModel<ReportViewModel>
{
   Data = _service.getAllActivitiesReport(queryType)
});

}


Due to the change noted here, any subsequent paging results in the query parameter originally passed being lost...

So I believe I need to pass the queryType string BACK to the view and then use  javascript to keep the query parameter persisted...

function dataBinding(args) {                        
    args.data = $.extend(args.data, { queryType: qType });
}

QUESTION IS: How do I pass the queryType value back as the only object being passed back from the Ajax Binding method is 
a GridModel??

Thanks!
Tags
Grid
Asked by
sL342799
Top achievements
Rank 1
Share this question
or