• dhtmlx之dhtmlXGrid显示数据 --大数据


    引用

         <link href="../../dhtmlXGridScripts/dhtmlxgrid.css" rel="stylesheet" type="text/css" />
        <link href="../../dhtmlXGridScripts/dhtmlxgrid_skins.css" rel="stylesheet" type="text/css" />
        <script src="../../dhtmlXGridScripts/dhtmlxcommon.js" type="text/javascript"></script>
        <script src="../../dhtmlXGridScripts/dhtmlxgrid.js" type="text/javascript"></script>
        <script src="../../dhtmlXGridScripts/dhtmlxgridcell.js" type="text/javascript"></script>
        <script src="../../Scripts/jquery-1.4.4.js" type="text/javascript"></script>
       <script> window.dhx_globalImgPath = "../../dhtmlxComboScripts/imgs/"; </script>
        <script src="../../dhtmlXGridScripts/ext/dhtmlxgrid_srnd.js" type="text/javascript"></script>

     <div id="gridbox1" style=" height:100%; 500px"></div>

     <script type="text/jscript">
            var mygrid; // 定义mygrid
            $(function () {
                mygrid = new dhtmlXGridObject('gridbox1');
                mygrid.setHeader("标题一,标题二,标题三"); // 设置grid的头
                mygrid.setInitWidths("150,150,150")
                mygrid.setColTypes("cntr,ro,ed");
                mygrid.setColAlign("center,center,center");
                mygrid.setColSorting("na,str,str");
                mygrid.setSkin("dhx_skyblue");
                mygrid.setColumnColor("#B0CDAF");
                mygrid.init(); // 初始化
                mygrid.enableSmartRendering(true); //加载大数据
                mygridjiazai(); // 调用方法,加载数据(数据库查询)
            });
            

            function mygridjiazai() {
                $.ajax({
                    type: "POST",
                    url: "/Main/GetDemoData",
                    cache: false,
                    success: function (result) {
                        mygrid.parse(result, "jsarray");
                    }
                });
            }

    </script>

    public ActionResult GetDemoData()
            {
                ArrayList jsonList = new ArrayList();
                foreach (DataRow dr in Demo.DemoData().Rows)
                {
                    jsonList.Add(new ArrayList() { dr["ID"], dr["Name"], dr["Content"] });
                }

               // string json = Demo.DataTable2Json(Demo.DemoData());
                return Json(jsonList, JsonRequestBehavior.AllowGet);
            }

  • 相关阅读:
    git commit --amend
    Interleaving String leetcode
    Longest Common Substring
    Distinct Subsequences Leetcode
    Longest Common Subsequence
    Palindrome Partitioning II Leetcode
    百度面试时遇到这样一个问题:给定数组a[];计算除最后一个元素之外其他元素的和,下面的代码有什么问题吗
    sizeof与strlen
    网络是怎么连接的(2)?
    网络是怎么连接的(1)?
  • 原文地址:https://www.cnblogs.com/zh1989/p/4150980.html
Copyright © 2020-2023  润新知