- 注册时间
- 2013-4-11
- 最后登录
- 2013-5-4
- 阅读权限
- 10
- 积分
- 47
- 精华
- 0
- 帖子
- 16
|
factory 发表于 2013-4-12 09:44
好的
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="css/css.css" rel="stylesheet" type="text/css" />
<script src="scripts/boot.js" type="text/javascript"></script>
</head>
<body>
<input id="Submit1" type="submit" value="测试按钮" onclick="submitform();" />
<br />
<div id="datagrid1" class="mini-datagrid" style="width: 95%; height: 280px;" idfield="id"
showfooter='false' allowcelledit="true" allowcellselect="true" multiselect="true"
editnextonenterkey="true" />
<div property="columns">
<div field="gtable" width="100" type="comboboxcolumn" >
表
<input id="gitable" property="editor" class="mini-combobox" textField="text" valueField="id" data="movetable" />
</div>
<div field="gcols" width="100" type="comboboxcolumn">
列
<input property="editor" class="mini-combobox" />
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript" language="javascript">
mini.parse();
//表初始数据
var movetable = { "id": "test", "text": "test" }
//得到表格
var grid = mini.get("datagrid1");
//增加5条空白数据
for (var i = 0; i < 2; i++) {
var newRow = { name: "New Row" };
grid.addRow(newRow, i);
}
//测试按钮事件
function submitform() {
var table = mini.get("gtable")
//增加5条空白数据
for (var i = 0; i < 2; i++) {
var newRow = { name: "New Row" };
grid.addRow(newRow, i);
}
//事件触发后得到的数据(这里测试使用随机数)
var strSysTable = Math.random() * 10;
var testt = { "id": strSysTable, "text": "test" + strSysTable }
movetable = testt;
//alert("dd");
}
</script>
|
|