我刚开始使用 jqGrid。我遇到了两种不同类型的 jqGrid,如下所示。
一个看起来像下面
<trirand:JQGrid ID="Jqgrid3" runat="server">
<Columns>
<trirand:JQGridColumn DataField="OrderID" PrimaryKey="True" />
<trirand:JQGridColumn DataField="Freight" Editable="true" />
<trirand:JQGridColumn DataField="OrderDate" Editable="true"/>
<trirand:JQGridColumn DataField="ShipCity" Editable="true" />
</Columns>
</trirand:JQGrid>
另一个看起来像下面
$("#list").jqGrid({
url: ResolveUrl() + '/DoctorList',
datatype: 'local',
postData: { "searchText": searchText },
mtype: 'POST',
ajaxGridOptions: { contentType: 'application/json; charset=utf-8' },
serializeGridData: function (jsondata) { return JSON.stringify(jsondata); },
jsonReader: { repeatitems: false, root: "d.rows", page: "d.page",
total: "d.total", records: "d.records" },
colNames: ['Add', 'DoctorID', 'Last Name', 'First Name', 'Address'],
colModel: [
{ name: 'AddAction', width: 80, fixed: true,
sortable: false, resize: false, align: "center" },
{ name: 'ID', index: 'ID', width: 50, sortable: false, hidden: false },
{ name: 'LastName', index: 'LastName', width: 100,
hidden: false, frozen: true, sortable: false },
{ name: 'FirstName', index: 'FirstName', width: 100, hidden:
false, frozen: true, sortable: false },
{ name: 'Address', width: 420, hidden: false, sortable: false,
jsonmap: function (obj) {
var street = obj.Address.Address1
var city = obj.Address.City
var state = obj.Address.StateProvince
var zip = obj.Address.PostalCode
if (street != '') { street = street + ', ' }
if (city != '') { city = city + ', ' }
if (state != '') { state = state + ', ' }
var Address = street + city + state + zip
return Address
}
}],
对于以前的类型,我可以在代码隐藏中做这样的事情
Jqgrid3.DataSource = GetTable() Jqgrid3.DataBind()
我不知道是否有办法从代码隐藏页面访问 cclist jqGrid。有人可以帮助我理解我如何理解上述两种不同的类型,与另一种相比有什么优势以及它们最适合哪些场景?
谢谢,
戴夫