如何用easyui+JAVA 实现动态拼凑datagrid表格
1个回答
展开全部
$('#表示你要在哪个table上添加').datagrid({
url:"地址",
iconCls: 'icon-edit',//图标
singleSelect: true,//是否选中一列
onClickRow: onEditClickRow,
columns:[[
{field:'tjs5104',title:'字段名称',width:60,align:'right',editor:'numberbox'},
{field:'tjs5102',title:'',width:80,align:'right',editor:{type:'numberbox',options:{precision:5}}},
{field:'byTime',title:'',width:60,align:'center',editor:{type:'checkbox',options:{on:'1',off:'0'}}},
{field:'lineLon',title:'',width:80,align:'center',
editor:{
type:'combobox',
options:{
valueField:'value',
textField:'text',
data:[{'value':'0','text':''},{'value':'1','text':''}],
required:true
}
}}
]],
toolbar:[{
text:'添加',
iconCls:'icon-add',
plain:true,
handler:appendEdit
},{
text:'删除',
iconCls:'icon-remove',
plain:true,
handler:removeitEdit
},{
text:'重置',
iconCls:'icon-cancel',
plain:true,
handler:rejectEdit
}]
});
url:"地址",
iconCls: 'icon-edit',//图标
singleSelect: true,//是否选中一列
onClickRow: onEditClickRow,
columns:[[
{field:'tjs5104',title:'字段名称',width:60,align:'right',editor:'numberbox'},
{field:'tjs5102',title:'',width:80,align:'right',editor:{type:'numberbox',options:{precision:5}}},
{field:'byTime',title:'',width:60,align:'center',editor:{type:'checkbox',options:{on:'1',off:'0'}}},
{field:'lineLon',title:'',width:80,align:'center',
editor:{
type:'combobox',
options:{
valueField:'value',
textField:'text',
data:[{'value':'0','text':''},{'value':'1','text':''}],
required:true
}
}}
]],
toolbar:[{
text:'添加',
iconCls:'icon-add',
plain:true,
handler:appendEdit
},{
text:'删除',
iconCls:'icon-remove',
plain:true,
handler:removeitEdit
},{
text:'重置',
iconCls:'icon-cancel',
plain:true,
handler:rejectEdit
}]
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询