- 注册时间
- 2012-5-23
- 最后登录
- 2014-5-19
- 阅读权限
- 10
- 积分
- 532
- 精华
- 0
- 帖子
- 164
|
qiceweip 发表于 2013-2-27 00:49
该问题已解决,是写法上有问题。
<body>
<div class="mini-panel" title="单位维护" style="width:100%;height:100%;"
borderStyle="border:0" showToolbar="true" showCollapseButton="false"
showFooter="true" showHeader="true" bodyStyle="padding:0;">
<!--body-->
<div class="mini-fit" style="height:100%;">
<div id="datagrid1" class="mini-datagrid"
style="width:100%;height:100%;" borderStyle="border:0"
url="unit/getList.do" idField="uid" allowResize="true" pageSize="10"
allowCellSelect="true" multiSelect="true" allowAlternating="true"
sortMode="client" sizeList=[5,10,20,50,100] loadingMSG="数据加载中.....">
<div property="columns">
<div type="checkcolumn"></div>
<div field="uname" width="120" headerAlign="center" align="center"
allowSort="true">单位名称</div>
<div name="action" width="50" headerAlign="center" align="center"
renderer="onActionRenderer" cellStyle="padding:0;">操作</div>
</div>
</div>
</div>
</div>
<div id="editWindow" class="mini-window" title="添加修改界面"
style="width:300px;height:100px;" showModal="true"
allowResize="true" allowDrag="true">
<div id="form1" class="form" >
<input class="mini-hidden" name="uid" />
<table style="width:100%;">
<tr>
<td>单位名称:<input id="uname" name="uname"
class="mini-textbox" required="true"
requiredErrorText="单位名称不能为空" /></td>
</tr>
<tr>
<td style="text-align:center;padding-top:5px;padding-right:20px;"
colspan="6"><a class="mini-button "
tooltip="确定">确定</a> <a class="mini-button"
tooltip="取消">取消</a>
</td>
</tr>
</table>
</form>
</div>
<script type="text/javascript">
mini.parse();
var grid = mini.get("datagrid1");
var editWindow = mini.get("editWindow");
var form = new mini.Form("#form1");
grid.load();
function onActionRenderer(e) {
var grid = e.sender;
var record = e.record;
var uid = record.uid;
var rowIndex = e.rowIndex;
var s = '<a class="New_Button" href="javascript:newRow()">添加</a> '
+ '<a class="Edit_Button" href="javascript:editRow(\''
+ uid
+ '\')">修改</a> '
+ '<a class="Delete_Button" href="javascript:delRow(\''
+ uid + '\')">删除</a>';
return s;
}
function newRow() {
var row = {};
grid.addRow(row, 0);
editRow(row.uid);
}
function editRow(uid) {
editWindow.show();
form.clear();
$.post("unit/getListById.do", {"uid":uid}, function (data) {
form.loading();
form.unmask();
form.setData(data);
});
}
function cancelRow() {
form.clear();
grid.reload();
editWindow.hide();
}
function sure(){
}
function delRow(uid){
}
</script>
</body>
这个是我的那个给弹出的form赋值 $.post("unit/getListById.do", {"uid":uid}, function (data) {
form.loading();
form.unmask();
form.setData(data);
});
这个data是个list 为什么不行啊
|
|