- 注册时间
- 2013-4-11
- 最后登录
- 2013-5-4
- 阅读权限
- 10
- 积分
- 47
- 精华
- 0
- 帖子
- 16
|
factory 发表于 2013-4-11 17:07
经测试,是可以setData()2次,甚至多次的,这个没有问题
你把你的主要代码贴上来我看看 ...
初始显示
<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" allowSort="true" type="comboboxcolumn" >表
<input id="gitable" property="editor" class="mini-combobox" style="width:100%;"
data="movetable" textField="text" valueField="id" value="111111" />
</div>
<div field="birthday" width="100" allowSort="true" type="comboboxcolumn" >列
<input property="editor" class="mini-combobox" style="width:100%;" />
</div>
</div>
初始设置
<script type="text/javascript">
//拖动的表
var movetable = [{"id":"test","text":"test"}];
var grid = mini.get("datagrid1");
grid.setTotalCount(100);
grid.setData([]);
for (var i = 0; i < 1; i++) {
var newRow = { name: "New Row" };
grid.addRow(newRow, i);
}
</script>
事件触发后
<script type="text/javascript">
var strSysTable ="测试";
var tabobj = {};
tabobj.id = strSysTable;
tabobj.text = strSysTable;
movetable.push(tabobj);
var index = grid.getData().length
var newRow = { gtable: "new Row" };
grid.addRow(newRow, index);
var data = grid.getData();
mini.get("gitable").setData(movetable);
mini.get("gitable").load(movetable);
</script> |
|