This is my first time with really trying to set up jqGrid with Lib.Web.MVC. Once I'm able to get the initial setup done, I should be able to roll along more smoothly.
I've downloaded the chm file for the Lib.Web.Mvc helper and looked under the JqGridHelper, but can't find anything on how to do the above subject line. I've also searched the web, but can't find anything specific on what I need to do.
I need to pass an object into my method as an input parameter but don't know how to set that up with Lib.Web.Mvc.
In jQuery, to set up the object, I was doing the following which passed in the object just fine.
var HH_FuelTkt_Input = {
Vehicle_No: $('#txtVehicleNbr').val(),
Customer_Name: $('#txtCustomerName').val(),
Trans_Timestamp_Begin: $('#dteBeginDate').val(),
Trans_Timestamp_End: $('#dteEndDate').val()
};
$.ajax({
url: '@Url.Action("GetFilteredFuelTicketsAsync")',
data: JSON.stringify(HH_FuelTkt_Input),
How can I accomplish this same thing using the lib.web.mvc namespace? Here is my code for that. Note that the line "JqGridParametersNames.HH_FuelTkt_Input" says that there is no definition for "HH_FuelTkt_Input". This makes sense, because the Helper can't find that object. How can I make the helper aware of that jQuery object?
<table id="fuelTickets" class="table">
@{
var grid = new JqGridHelper<FuelTktImgRetrievalMdl.ViewModels.HH_FuelTkt_Output>("FuelTickets",
dataType: JqGridDataTypes.Json,
methodType: JqGridMethodTypes.Post,
pager: true,
rowsNumber: 10,
sortingName: "FuelTkt_ID",
sortingOrder: JqGridSortingOrders.Asc,
viewRecords: true,
autoWidth: true,
gridView: true,
JqGridParametersNames.HH_FuelTkt_Input,
url: Url.Action("GetFilteredFuelTicketsAsync"),
caption: "Fuel Tickets",
onCellSelect: "getImageId",
emptyRecords: "No records to view"
);
}
</table>
You can achieve this with PostDataScript property, something like this:
The object will be available to your action method in standard way (for example you can create an entity for it and make that entity another parameter of your action).