我正在尝试将其他值(作为过滤器)传递给 jquery bootgrid。在我的表单中,我有两个日期范围,每次日期更改时我都需要刷新网格数据。
处理程序 requestHandler和(过时的)帖子允许我将其他参数传递给服务器,遵守标准
但是当我发布我的请求时,我无法添加我的自定义参数。使用萤火虫我只能看到标准参数喜欢
current=1
rowCount=10
searchPhrase=
请帮我!!
下面是我完整的 HTML 代码
<table id="grid-data" class="table table-condensed table-hover table-striped" data-toggle="bootgrid" data-ajax="true" data-url="HelpDesk/server.php">
<thead>
<tr>
<th data-column-id="ticket_no" data-type="string" data-identifier="true">ticket_no</th>
<th data-column-id="title">title</th>
<th data-column-id="parent_id" data-type="string">parent_id</th>
<th data-column-id="contact_id" data-type="string">contact_id</th>
<th data-column-id="status">status</th>
<th data-column-id="priority" data-type="string">priority</th>
<th data-column-id="smownerid" data-type="string">smownerid</th>
</tr>
</thead>
</table>
和我的 js/jquery 代码
<!-- now write the script specific for this grid -->
<script language="javascript">
jQuery( document ).ready(function() {
var grid = $("#grid-data").bootgrid({
ajax: true,
url: "HelpDesk/server.php",
//requestHandler
//Transforms the JSON request object in what ever is needed on the server-side implementation.
// Default value is function (request) { return request; }.
requestHandler: function(request)
{
console.log("requestHandler - nevel called");
console.log(request);
return request;
}/*,
post: function ()
{
console.log("post - nevel called");
return {datefrom:'aaaaaaaaa',dateto:'vvvvvvvvvv'};
}*/
});
$('input[name="srch"]').click(function(){
$("#grid-data").bootgrid("reload");
});
});
</script>