- 注册时间
- 2014-12-18
- 最后登录
- 1970-1-1
- 阅读权限
- 10
- 积分
- 17
- 精华
- 0
- 帖子
- 2
|
:) MiniUI的程序员,您好:
<script type="text/javascript">
$(function () {
mini.parse();
var data = new Array();
var item1 = {};
item1["col1"] = "C11";
item1["col2"] = "C12";
item1["col3"] = [{ "t1": "Testa", "t2": "Testb" }, { "t1": "Testc", "t2": "Testd"}];
var item2 = {};
item2["col1"] = "C21";
item2["col2"] = "C22";
item2["col3"] = [{ "t1": "TestA", "t2": "TestB" }, { "t1": "TestC", "t2": "TestD"}];
data.push(item1);
data.push(item2);
mini.get("datagrid1").setData(data);
});
function onShowRowDetail(e) {
var grid = e.sender;
var row = e.record;
var dataSource = row["col3"];
var td = grid.getRowDetailCellEl(row);
mini.get("datagridDetail").setData(dataSource);
$("div#datagridDetailContainer").show();
td.innerHTML = "";
$("div#datagridDetailContainer").appendTo(td);
}
function reBindData() {
var data = new Array();
var item1 = {};
item1["col1"] = "C111";
item1["col2"] = "C112";
item1["col3"] = [{ "t1": "Testaa", "t2": "Testbb" }, { "t1": "Testcc", "t2": "Testdd"}];
var item2 = {};
item2["col1"] = "C221";
item2["col2"] = "C222";
item2["col3"] = [{ "t1": "TestAA", "t2": "TestBB" }, { "t1": "TestCC", "t2": "TestDD"}];
data.push(item1);
data.push(item2);
mini.get("datagrid1").setData(data);
}
</script>
<body>
<span style="color:Blue;" onclick="reBindData();">ReSetData</span>
<div id="datagrid1" class="mini-datagrid" style="width:700px;height:auto;" onshowrowdetail="onShowRowDetail" autoHideRowDetail="true">
<div property="columns">
<div type="expandcolumn"></div>
<div type="indexcolumn" ></div>
<div field="col1">Col1</div>
<div field="col2">Col2</div>
</div>
</div>
<div id="datagridDetailContainer" style="display:none;">
<div id="datagridDetail" class="mini-datagrid" style="height:auto;" showpager="false">
<div property="columns">
<div type="indexcolumn" ></div>
<div field="t1">T1</div>
<div field="t2">T2</div>
</div>
</div>
</div>
</body>
问题是这样的,在展开DetailRow之后,再次为Grid做setData动作,在这之后,DetailRow就不可见了。。
是俺的调用方法问题吗?求助 :) |
|