This question is locked. New answers and comments are not allowed.
I have a master - detail pair of tables and I want to be able to edit the rows of the detail table.
(MVC3, Ajax binding, Razor engine)
In the RowSelect event on the master table, I call rebind with the masterId that the detail table needs :
This works as far as I can determine - Firebug tells me that the masterId parameter is being posted to the SelectDetails ajax call.
For Insert, I figured it would be reasonable to suspect that the same pattern applies. So I added
to the databinding, figuring that rebind would hit that too. But it doesn't.
So how can I add my client side parameter to the Insert ajax call if not via rebind? I've tried adding the masterId to the list of DataKeys - that doesn't seem to do anything. I've tried getting the master id from a ViewBag, but the opportunity to store that data in the view seems to be in the Select controller part, and since that's a grid action I think the JSON serializer eats the View Bag, and that data never gets there.
I think I can manually go into the Grid object and edit the Insert URL property in the Ajax object but that doesn't seem sensible to me - there must be a better way.
(MVC3, Ajax binding, Razor engine)
In the RowSelect event on the master table, I call rebind with the masterId that the detail table needs :
//jsvar masterId = e.row.cells[0].innerHTML;detailGrid.rebind({ masterId : masterId});
//where else where, the detail table is
//snipped
.DataBinding( data => data.Ajax()
.Select("doDetailSelect", "ControllerName", new {masterId = ""}
... This works as far as I can determine - Firebug tells me that the masterId parameter is being posted to the SelectDetails ajax call.
For Insert, I figured it would be reasonable to suspect that the same pattern applies. So I added
.Insert("InsertDetail", "ControllerName", new {masterId = ""}So how can I add my client side parameter to the Insert ajax call if not via rebind? I've tried adding the masterId to the list of DataKeys - that doesn't seem to do anything. I've tried getting the master id from a ViewBag, but the opportunity to store that data in the view seems to be in the Select controller part, and since that's a grid action I think the JSON serializer eats the View Bag, and that data never gets there.
I think I can manually go into the Grid object and edit the Insert URL property in the Ajax object but that doesn't seem sensible to me - there must be a better way.