当前位置: 代码迷 >> ASP >> ligerui 开始折腾,后头纠结,现在求组
  详细解决方案

ligerui 开始折腾,后头纠结,现在求组

热度:453   发布时间:2014-03-01 00:36:55.0
ligerui 开始折腾,后面纠结,现在求组
第一次用这个东东,前台页面都用ligerui给做好了。结果在绑数据的时候出了问题,发现表格绑不起数据,最后一直用官网的demo做测试,一直没成功,纠结蛋疼ing,界面用它做完了,不可能砍了它重做一次页面吧。阿门!

下面是代码,demo里的代码。。。。将本地请求改为了ajax

html页面

<script type="text/javascript">
             var grid = null;
             $(function () {
                 grid = $("#maingrid4").ligerGrid({
                     columns: [
                { display: '主键', name: 'CustomerID', align: 'left', width: 120 },
                { display: '公司名', name: 'CompanyName', minWidth: 60 },
                { display: '联系名', name: 'ContactName', width: 50, align: 'left' },
                { display: '联系名', name: 'ContactName', minWidth: 140 },
                { display: '城市', name: 'City' }
                ],
                     pageSize: 30,
                     url: "AjaxServer.aspx",
                     width: '100%',
                     height: '80%'
                 });
                 $("#pageloading").hide();
             });
    </script>


ajax请求的页面

// string str=       File.ReadAllText(@"D:\MyCode\LigerUI\WebApplication1\WebApplication1\CustomersData.js");
          //System.Web.HttpContext context = System.Web.HttpContext.Current;
          //context.Response.ContentType = "text/plain";
          //context.Response.Write(str);
           string str = @"{""Rows"":[{""CustomerID"":""ALFKI""}],""Total"":""1""}";
          // var javascript =JavaScriptConvert.DeserializeObject(str);
           Response.Write(str);
           Response.Flush();
           Response.End();


json数据,也是demo中的

{Rows:
[
{"CustomerID":"ALFKI","CompanyName":"Alfreds Futterkiste","ContactName":"Maria Anders","ContactTitle":"Sales Representative","Address":"Obere Str. 57","City":"Berlin","Region":null,"PostalCode":"12209","Country":"Germany","Phone":"030-0074321","Fax":"030-0076545"},
{"CustomerID":"ANATR","CompanyName":"Ana Trujillo Emparedados y helados","ContactName":"Ana Trujillo","ContactTitle":"Owner","Address":"Avda. de la Constitución 2222","City":"México D.F.","Region":null,"PostalCode":"05021","Country":"Mexico","Phone":"(5) 555-4729","Fax":"(5) 555-3745"},
{"CustomerID":"ANTON","CompanyName":"Antonio Moreno Taquería","ContactName":"Antonio Moreno","ContactTitle":"Owner","Address":"Mataderos  2312","City":"México D.F.","Region":null,"PostalCode":"05023","Country":"Mexico","Phone":"(5) 555-3932","Fax":null},
{"CustomerID":"AROUT","CompanyName":"Around the Horn","ContactName":"Thomas Hardy","ContactTitle":"Sales Representative","Address":"120 Hanover Sq.","City":"London","Region":null,"PostalCode":"WA1 1DP","Country":"UK","Phone":"(171) 555-7788","Fax":"(171) 555-6750"},
{"CustomerID":"BERGS","CompanyName":"Berglunds snabbk?p","ContactName":"Christina Berglund","ContactTitle":"Order Administrator","Address":"Berguvsv?gen  8","City":"Lule?","Region":null,"PostalCode":"S-958 22","Country":"Sweden","Phone":"0921-12 34 65","Fax":"0921-12 34 67"},
{"CustomerID":"BLAUS","CompanyName":"Blauer See Delikatessen","ContactName":"Hanna Moos","ContactTitle":"Sales Representative","Address":"Forsterstr. 57","City":"Mannheim","Region":null,"PostalCode":"68306","Country":"Germany","Phone":"0621-08460","Fax":"0621-08924"},
{"CustomerID":"BLONP","CompanyName":"Blondel père et fils","ContactName":"Frédérique Citeaux","ContactTitle":"Marketing Manager","Address":"24, place Kléber","City":"Strasbourg","Region":null,"PostalCode":"67000","Country":"France","Phone":"88.60.15.31","Fax":"88.60.15.32"},
  相关解决方案
本站暂不开放注册!
内测阶段只得通过邀请码进行注册!
 
  • 最近登录:Sat Jun 24 03:09:25 CST 2017
  • 最近登录:Sat Jun 24 03:09:25 CST 2017
  • 最近登录:Sat Jun 24 03:09:25 CST 2017
  • 最近登录:Sat Jun 24 03:09:25 CST 2017
  • 最近登录:Sat Jun 24 03:09:25 CST 2017