jQuery MiniUI

标题: 动态创建datagrid失败 [打印本页]

作者: thunder_0927    时间: 2014-3-11 09:39:34     标题: 动态创建datagrid失败

本帖最后由 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


作者: felt    时间: 2014-3-11 09:48:27

<div id="mainPage"></div>
这个不是MiniUI控件
var mainPage=document.getElementById("mainPage");
arrGrid[i].render(mainPage);
作者: thunder_0927    时间: 2014-3-11 09:50:11

felt 发表于 2014-3-11 09:48
这个不是MiniUI控件
var mainPage=document.getElementById("mainPage");
arrGrid.render(mainPage); ...

谢谢!!!!!!!!!!!!!!!
作者: thunder_0927    时间: 2014-3-11 09:57:02

felt 发表于 2014-3-11 09:48
这个不是MiniUI控件
var mainPage=document.getElementById("mainPage");
arrGrid.render(mainPage); ...



请问动态生成这样多级的列如何实现
作者: thunder_0927    时间: 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!
作者: felt    时间: 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........},{},{}]}




欢迎光临 jQuery MiniUI (http://miniui.com/discuss/) Powered by Discuz! X2