【发布时间】:2010-07-07 10:50:52
【问题描述】:
我想在不使用 Web 服务的情况下在 ASP.NET 中将 jQgrid 与静态数据绑定。谁能帮帮我。
【问题讨论】:
标签: asp.net jqgrid jqgrid-asp.net
我想在不使用 Web 服务的情况下在 ASP.NET 中将 jQgrid 与静态数据绑定。谁能帮帮我。
【问题讨论】:
标签: asp.net jqgrid jqgrid-asp.net
看看这个例子 - http://www.trirand.com/jqgridwiki/doku.php?id=wiki:first_grid
没有对 web 服务的异步调用...只是普通的旧 javascript -
colNames:['Inv No','Date', 'Amount','Tax','Total','Notes'],
colModel :[
{name:'invid', index:'invid', width:55},
{name:'invdate', index:'invdate', width:90},
{name:'amount', index:'amount', width:80, align:'right'},
{name:'tax', index:'tax', width:80, align:'right'},
{name:'total', index:'total', width:80, align:'right'},
{name:'note', index:'note', width:150, sortable:false}
],
【讨论】:
您的问题可以通过不同的方式解决:
data 参数并填充所有值。查看演示 http://trirand.com/blog/jqgrid/jqgrid.html 并在左侧树中选择“3.7 版中的新功能”,然后选择“立即加载数组数据”。addRowData方法(见http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods)来填充数据。datatype 和“GET”作为mtype 参数。您创建一个像 mydata.txt 或 mydata.xml 这样的静态页面,其中包含通常从服务器动态发送的完整响应,将文件放在 Web 服务器上,并将页面的 URL 用作 jqGrid 的url 参数。如果我回答来自 stackoverflow 的一些问题,我通常会这样做。以http://www.ok-soft-gmbh.com/jqGrid/DataFetcher.htm 或http://www.ok-soft-gmbh.com/jqGrid/Jqgrid37.htm 为例,并查看相应页面的来源。【讨论】: