- 注册时间
- 2013-12-19
- 最后登录
- 2014-3-14
- 阅读权限
- 10
- 积分
- 117
- 精华
- 0
- 帖子
- 29
|
factory 发表于 2014-2-20 13:30
我已经说了啊,没区别,
一样是oncellbeginedit
<!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>
<title>CellEdit2 单元格切换编辑 </title>
<meta http-equiv="content-type" content="textml; charset=UTF-8" />
<link href="../demo.css" rel="stylesheet" type="text/css" />
<script src="../../scripts/boot.js" type="text/javascript"></script>
<!--引入皮肤样式-->
<link href="../../scripts/miniui/themes/blue/skin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>CellEdit2 单元格切换编辑</h1>
<div id="datagrid1" class="mini-datagrid" style="width:300px;height:170px;"
url="http://www.miniui.com/demo/datagrid/data3.txt" idField="id"
allowResize="true" showPager="false"
allowCellSelect="true"
>
<div property="columns">
<div type="indexcolumn"></div>
<div field="name" allowResize="false" width="120" headerAlign="center" allowSort="true">属性</div>
<div field="value" width="100" allowSort="true" >值</div>
</div>
</div>
<div style="display:none;">
<input class="mini-textbox" id="textboxEditor" />
<input class="mini-spinner" id="spinnerEditor" />
<input class="mini-datepicker" id="datepickerEditor" />
<input class="mini-timespinner" id="timeEditor" />
<input class="mini-combobox" id="booleanEditor" data="booleanData"/>
<input class="mini-combobox" id="countrysEditor" url="../data/countrys.txt"/>
</div>
<script type="text/javascript">
var booleanData = [
{ text: "是", id: true },
{ text: "否", id: false }
];
mini.parse();
var grid = mini.get("datagrid1");
grid.load();
//////////////////////////////////////////////////////
function getEditor(record){
var id = record.editor +"Editor";
var editor = mini.get(id);
return editor;
}
grid.on("cellbeginedit", function (e) {
if (e.field == "value") {
var editor = getEditor(e.record);
e.editor = editor;
e.column.editor = editor;
}
});
grid.on("rowdblclick", function (e) {
grid.beginEditRow (e.record);
});
</script>
<div class="description">
<h3>Description</h3>
<ul>
</ul>
</div>
</body>
<html>
官网例子修改成行编辑就不行了,你看一下吧,(ps:原例子是用单元格编辑的) |
|