- 注册时间
- 2012-10-29
- 最后登录
- 2013-6-23
- 阅读权限
- 10
- 积分
- 135
- 精华
- 0
- 帖子
- 33
|
代码:
<a class="mini-button" iconCls="icon-add" plain="true">增加</a>
<a class="mini-button" iconCls="icon-remove" plain="true">删除</a>
<span class="separator"></span>
<a class="mini-button" iconCls="icon-save" plain="true">保存</a>
<div id="dbtgrid" class="mini-datagrid" style="width:100%;height:90%;"
url='<cut value="${searchUrl}" escapeXml="false"/>' idField="DBTID"
allowResize="true" pageSize="16" >
<div property="columns">
<div type="checkcolumn"></div>
<div field="DBTNAME" width="120" headerAlign="center" allowSort="true">名称
<input property="editor" class="mini-textbox" style="width:100%;" />
</div>
<!--ComboBox:本地数据-->
<div type="comboboxcolumn" autoShowPopup="true" field="DBTSTATUS" width="100" allowSort="true" align="center" headerAlign="center">状态
<input property="editor" class="mini-combobox" style="width:100%;" data="State"/>
</div>
</div>
</div>
function dbtadd() {
var newRow = { name: "New Row" };
dbtgrid.addRow(newRow, 0);
dbtgrid.beginEditRow(newRow);
}
function dbtsave() {
var data = dbtgrid.getEditData(true);
var json = mini.encode(data);
dbtgrid.loading("保存中,请稍后......");
var inserttianUrl='<cut value="${inserdbtUrl}" escapeXml="false"/>';
jQuery.ajax({
url: inserttianUrl,
data: { data: json },
type: "post",
success: function (text) {
dbtgrid.reload();
},
error: function (jqXHR, textStatus, errorThrown) {
alert(jqXHR.responseText);
}
});
}
|
|