jQuery MiniUI

 找回密码
 立即注册
查看: 1841|回复: 5
打印 上一主题 下一主题

动态创建datagrid失败 [复制链接]

Rank: 3Rank: 3

跳转到指定楼层
楼主
发表于 2014-3-11 09:39:34 |只看该作者 |倒序浏览
本帖最后由 thunder_0927 于 2014-3-11 09:40 编辑
  1. <div id="mainPage"></div>
复制代码
  1. var i = 0;
  2.             var arrGrid = new Array();
  3.             for (i; i < arrHospitals.length; i++) {
  4.                 var temp = arrHospitals[i];
  5.                 arrGrid[i] = new mini.DataGrid();
  6.                 arrGrid[i].set({
  7.                     url: "",
  8.                     style: "width:700px;height:280px;",
  9.                     columns: [
  10.                             { type: "indexcolumn" },
  11.                             { field: "loginname", width: 120, headerAlign: "center", allowSort: true, header: "员工账号", editor: { type: "textbox", minValue: 0, maxValue: 200, value: 25 } },
  12.                             { field: "age", width: 100, headerAlign: "center", allowSort: true, header: "年龄", editor: { type: "spinner" } },
  13.                             { field: "birthday", width: 100, headerAlign: "center", dateFormat: "yyyy-MM-dd H:mm", allowSort: true, header: "生日", editor: { type: "datepicker" } },
  14.                             { field: "remarks", width: 120, headerAlign: "center", allowSort: true, header: "备注", editor: { type: "textarea" } },
  15.                             //{ field: "gender", type: "comboboxcolumn", autoShowPopup: true, width: 100, headerAlign: "center", header: "性别", editor: { type: "combobox", data: Genders } },
  16.                             //{ field: "country", type: "comboboxcolumn", width: 100, headerAlign: "center", header: "国家", editor: { type: "combobox", url: "../data/countrys.txt" } },
  17.                             { field: "married", trueValue: 1, falseValue: 0, type: "checkboxcolumn", width: 60, headerAlign: "center", header: "婚否" }
  18.                     ]
  19.                 });

  20.                 arrGrid[i].render(mini.get("mainPage"));
复制代码


未生成datagrid

Rank: 8Rank: 8

沙发
发表于 2014-3-11 09:48:27 |只看该作者
<div id="mainPage"></div>
这个不是MiniUI控件
var mainPage=document.getElementById("mainPage");
arrGrid[i].render(mainPage);

Rank: 3Rank: 3

板凳
发表于 2014-3-11 09:50:11 |只看该作者
felt 发表于 2014-3-11 09:48
这个不是MiniUI控件
var mainPage=document.getElementById("mainPage");
arrGrid.render(mainPage); ...

谢谢!!!!!!!!!!!!!!!

Rank: 3Rank: 3

地板
发表于 2014-3-11 09:57:02 |只看该作者
felt 发表于 2014-3-11 09:48
这个不是MiniUI控件
var mainPage=document.getElementById("mainPage");
arrGrid.render(mainPage); ...



请问动态生成这样多级的列如何实现

Rank: 3Rank: 3

5#
发表于 2014-3-11 10:02:16 |只看该作者
felt 发表于 2014-3-11 09:48
这个不是MiniUI控件
var mainPage=document.getElementById("mainPage");
arrGrid.render(mainPage); ...

{header: "a",
      columns: [
         {header: "b"}
      ]
   },


get!

Rank: 8Rank: 8

6#
发表于 2014-3-11 10:02:47 |只看该作者
thunder_0927 发表于 2014-3-11 09:57
请问动态生成这样多级的列如何实现

{ field: "married", trueValue: 1, falseValue: 0, type: "checkboxcolumn", width: 60, headerAlign: "center", header: "婚否" ,columns:[{field:xxx........},{},{}]}

Archiver|普加软件

GMT+8, 2024-9-28 23:07 , Processed in 1.091379 second(s), 10 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部