I have a jqGrid script like that:
jQuery(document).ready(function() {
var startDate = $("#startDate").Val();
jQuery("#sandgrid").jqGrid({
url: "/Deposit/Search?startDate='" + startDate + "'",
datatype: 'json',
mtype: 'GET',
height: 255,
width: 700,
colNames: ['Index', 'Name', 'Code'],
colModel: [
{ name: 'item_id', index: 'item_id', width: 65 },
{ name: 'item', index: 'item', width: 150 },
{ name: 'item_cd', index: 'item_cd', width: 100}],
pager: jQuery('#sandgridp'),
rowNum: 10,
rowList: [5, 10, 20, 50],
sortname: 'item_id',
sortorder: "desc",
viewrecords: true,
caption: 'My Grid'
});
});
In the view, there also have a input text box:
<td>
<% Html.jQuery().DatePicker()
.Name("startDate")
.Render(); %>
</td>
What I want to do is to pass the value from "startDate" to call jqGrid's url: "/Deposit/Search?startDate='" + startDate + "'". But it seems the data does not pass into the url. WHat is the issue? Is any other approach available for doing a searching function with jqGrid?
Thanks a lot!!