datagrid
rel="stylesheet" type="text/css" href="../themes/default/easyui.css">
<script type="text/javascript" src="../jquery.min.js"></script>
<script type="text/javascript" src="../jquery.easyui.min.js"></script>
<script>
$(document).ready(function(e) {
$('#dg').propertygrid({
url:'',
loadMsg:'数据加载中,请稍后......',
border:false,
fitColumns:true,
remoteSort:false,
singleSelect:true,
scrollbarSize: 0,
onClickRow:function(rowIndex,rowData){
//失去焦点的时候获取值
$("input.datagrid-editable-input").blur(
function(){
alert($(this).val());
}
);
},
frozenColumns:[[
{field:'ck',checkbox:true}
]],
toolbar:[
{text:'刷新',iconCls:'icon-reload',handler:function(){
Reload();
}},
{text:'添加',iconCls:'icon-add',handler:function(){
alert('添加');
}},
{text:'编辑',iconCls:'icon-edit',handler:function(){
alert('编辑');
}},
{text:'删除',iconCls:'icon-cut',handler:function(){
alert("删除");
}},
{text:'清选',iconCls:'icon-undo',handler:function(){
$("#dg").datagrid("clearSelections");
}}
],
columns:[[
{ field: 'name', title: '属性名', width:50, resizable: true },
{ field: 'value', title: '属性值', width:200, resizable: false }
]]
});
var obj = {
'total':100,
'rows':
[
{ "field": "id", "name": "ID", "value": "222", "editor": "text"},
{ "field": "name", "name": "名称", "value": "", "editor": "text" },
{ "field": "spacename", "name": "命名空间", "value": "", "editor":'text'},
{ "field": "des", "name": "描述", "value": "", "editor": "text" }
]
};
$('#dg').propertygrid('loadData',obj);
});
</script>
easyui-propertygrid单元格失去焦点获取值
最新推荐文章于 2023-05-05 08:41:53 发布