Ext4下 grid 里面的checkbox,checkbox的事件及toolbar设置
来源:互联网 发布:java反射调用方法参数 编辑:程序博客网 时间:2024/06/14 05:36
1 设置grid 每行checkbox
var myGridPanel = new Ext.grid.GridPanel({
selModel : new Ext.selection.CheckboxModel(),
loadMask:true,
autoScroll : true,
id:'processDefineGridPanel',
store : processDefinitionStore,
stripeRows : true,
columns : [
]
});
2 获取选中的checkbox的记录
var records= myGridPanel.getSelectionModel().getSelection();
for(var i=0;i<records.length;i++){
var name=records[i].data["name"];
}
3 checkbox监控及设置toolbar
var myGridPanel = new Ext.grid.GridPanel({
listeners : {
selectionchange : function(view,selections) {
if ( processDefineGridPanel.getSelectionModel().hasSelection() ){
Ext.getCmp("tbarDelInstances").setDisabled(false);
Ext.getCmp("tbarDelProcess").setDisabled(false);
Ext.getCmp("tbarDisableProcess").setDisabled(false);
Ext.getCmp("tbarEnableProcess").setDisabled(false);
} else {
Ext.getCmp("tbarDelInstances").setDisabled(true);
Ext.getCmp("tbarDelProcess").setDisabled(true);
Ext.getCmp("tbarDisableProcess").setDisabled(true);
Ext.getCmp("tbarEnableProcess").setDisabled(true);
}
},
// select:function(view,selections) {
// }
}
}
4 toolbar 的设置
var myGridPanel = new Ext.grid.GridPanel({
tbar :
[
{
id : 'tbarAdd' ,
iconCls : 'myIconDefine', // myIconDefine like this .It is style .myIconDefine { background:url( <%=rootPath%>/image/delete.png ) no-repeat !important; }
tooltip:"Install Process",
handler : function() {
// tool button event
}
}, '-',
]
});
5 grid 行颜色设置
var myGridPanel = new Ext.grid.GridPanel({
viewConfig : {
forceFit : true,
scrollOffset : 0,
getRowClass : function(record,rowIndex,rowParams,store){
if(record.data["state"]=="DISABLED"){
return 'process-disable'; //style define like .process-disable { color: #FF0000; }
}else{
return 'process-enabled';
}
}
}
}
})
6. checkbox事件
var setOldProcessForm = new Ext.form.Panel({
method : 'post',
id : 'displayOldProcess',
bodyPadding: 5,
width: 800,
height:150 ,
url : '<%=rootPath%>' + '/saveManagerProcessFlag.action',
defaults: {
anchor: '100%'
},
items: [
{
id : 'newest',
xtype : 'checkboxfield' ,
boxLabel: 'Is Display Old Process',
name: 'newest',
listeners: {
'change': function() {
console.info("OK change");
},
}
},
{
id : 'oldstart',
xtype : 'checkboxfield' ,
boxLabel: 'Is Start Old Process',
name: 'oldstart',
},
]
,
buttons: [{
text: 'Reset',
handler: function() {
this.up('form').getForm().reset();
}
}, {
text: 'Submit',
formBind: true,
handler: function() {
var form = this.up('form').getForm();
form.submit({
success: function(form, action) {
Ext.Msg.alert('Success', "Update Success");
},
failure: function(form, action) {
Ext.Msg.alert('Failed', "Update Fail");
}
});
}
}]
});
- Ext4下 grid 里面的checkbox,checkbox的事件及toolbar设置
- checkbox的checked事件
- 29、C#里面多选框CheckBox的属性和事件
- ext4.2中带checkbox框的树的点击事件的问题
- 设置Checkbox的值
- Checkbox的只读设置
- 设置checkbox的大小
- checkbox的只读设置
- Ext Grid checkBox 监听事件
- EazyUI Grid和TreeGrid的 CheckBox 模式
- ext2 'checkbox'的单击事件
- 关于CheckBox的回车事件
- CheckBox的事件响应顺序
- Android入门--多选项CheckBox 及CheckBox选择事件 的应用
- checkbox 里面的value的作用
- android CheckBox控件的定义及事件监听
- android CheckBox控件的定义及事件监听
- android CheckBox控件的定义及事件监听
- 难记的Tcode
- MessageQueue c# 例子
- js对第列表中第一个值处理与jsp页面对列表中第一个值处理区别
- Oracle11g数据库导入Oracle10g数据库 EXPDP工具
- 【Log4j】Log4j使用总结
- Ext4下 grid 里面的checkbox,checkbox的事件及toolbar设置
- [HTML5]Application Cache使用中需要注意的事项
- 捕捉屏幕字段值
- 用C#创建Windows服务(Windows Services)
- C#笔记
- poj3693
- web 工程下 java操作属性文件保存在classes下的读写操作
- OpenCVS 2.3.1在VS2010里面的配置
- 扩展Windows 7内存 巧用ReadyBoost提速