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

[Solved] Linking to a parameterised Ajax bound form

0 Answers 11 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.
Stuart
Top achievements
Rank 1
Stuart asked on 25 Jun 2012, 06:43 AM
I have a number of forms populated using Ajax binding, so for each of these forms I have two action methods, one of which has the GridAction attribute, all this is working fine;

public virtual ViewResult Orders() {}
 
[GridAction]
public virtual ViewResult OrdersAjax() {}

I have another form (call it the source form), from this form I want to link to the above target forms using a URL and pass in some filter to the Ajax bound forms, filtering for example on customer Id and order Id. I've added a bunch of buttons on the source form on each row, I want to set some link on the URL of these buttons so that they each call one of the target forms passing in data specific to the data row holding the buttons. The target Ajax bound form when displayed will be filtered using the argumens passed from the source.
I understand that I can add parameters to the Ajax method and then enter those parameters in the Select statement of the the calling form e.g. I'd adapt the above to

[GridAction]
public virtual ViewResult OrdersAjax(int orderId, int customerId) {}


and then in the source grid the binding statement would look like;
.DataBinding(dataBinding => dataBinding.Ajax().Select<TheController>(controller => controller.OrdersAjax(123, 567)))

However this only provides for one set of arguments for all rows in the source of the link.

How can I configure my source grid such that I can send row specific arguments to another ajax bound grid and filter on those arguments?
Ultimately I need to have a menu that links to a number of forms filtering based on the source form.
Tags
Grid
Asked by
Stuart
Top achievements
Rank 1
Share this question
or