我有一个与asp.Net Web Forms一起使用的jqGrid,它正确显示了数据库中所需的信息,但是它也显示了搜索选项,但是如果我尝试搜索,可以说等于Lijo的名字,它只是没有显示该记录。该记录存在。我知道我确实缺少某些肯定要搜索的东西,这是代码
<script type="text/javascript">
$(function() {
$("#UsersGrid").jqGrid({
url: 'ModCust.ashx',
datatype: 'json',
height: 250,
width: 800,
colNames: ['Application No', 'First Name', 'Middle Name', 'Last Name'],
colModel: [
{ name: 'cApplicationNo', index: 'cApplicationNo', width: 100, sortable: true},
{ name: 'cFirstName', width: 100, sortable: true},
{ name: 'cMiddleName', width: 100, sortable: true },
{ name: 'cLastName', width: 100, sortable: true },
],
cmTemplate: { title: false},
rowNum: 10,
rowList: [10, 20, 30],
pager: '#UsersGridPager',
sortname: 'cApplicationNo',
viewrecords: true,
sortorder: 'asc',
caption: 'Customer Details'
});
$("#UsersGrid").jqGrid('navGrid', '#UsersGridPager', { edit: false, add: false, del: false });
});
</script>
这是我的ModCust.ashx处理程序
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data;
using System.Data.SqlClient;
using System.Web;
using System.Web.Script.Serialization;
namespace CwizBankApp
{
public struct JQGridResults
{
public int page;
public int total;
public int records;
public JQGridRow[] rows;
}
public struct JQGridRow
{
public string id;
public string[] cell;
}