?要想達到自定義顯示表格框的目的比如顯示圖片,超鏈接,按鈕的形式,只需要給列添加formatter屬性即可,比如顯示圖片:
columns: [[
??????????????????????????????? { field: 'IName', title: '顯示名稱', width: 50 }, //checkbox。多選框的列
??????????????????????????????? {
??????????????????????????????????? field: 'Iurl', title: '圖片', width: 80,
??????????????????????????????????? formatter: function (value, row, index) {
??????????????????????????????????????? return "<img src='" + value + "' width='30' height='30'/>";
??????????????????????????????????? }
??????????????????????????????? },
??????????????????????????????? { field: 'ImgOrder', title: '顯示順序', width: 60 }
??????????????? ]],
-------------------------------------分頁案例:
? /// <summary>
??????? /// 設置滾動圖片
??????? /// </summary>
??????? /// <returns></returns>
??????? public ActionResult GetGunDong()
??????? {
??????????? int total = 0;
??????????? int pageIndex = Request["page"] == null ? 1 : int.Parse(Request["page"]);
??????????? int pageSize = Request["rows"] == null ? 10 : int.Parse(Request["rows"]);
??????????? var list = giss.LoadEntities(c => c.CId == CurrentCan.Id);
??????????? total = list.Count();
??????????? var listResult = list.OrderBy(u => u.ImgOrder).Skip((pageIndex - 1) * pageSize).Take(pageSize);
??????????? var data = new { total = total, rows = from l in listResult select new { l.Id, l.Iurl, l.IName, l.CId, l.ImgOrder } };
??????????? //內部會 幫我們? 序列化成json格式數據
??????????? return Json(data, JsonRequestBehavior.AllowGet);
??????? }
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
