在Grid上添加两行工具栏(搜索用)、根据数据确定某行使用的CSS


var lineColor = function(record,rowIndex,rowParams,store){
//锁定用户显示红色
var _flag = record.data['flag'];
var _css;
if(_flag == "0") _css = 'x-grid-record-red';
else if(_flag == "1") _css = 'x-grid-record-blue';
else _css = 'x-grid-record-gray';
return _css;
};

[color=red]var searchBar = [
' ', '姓名:', ' ', { xtype : 'textfield', width : '70', id : 'q_name' },
' ', '学/工号:', ' ', { xtype : 'textfield', width : '85', id : 'q_sno' },
' ', '部门:', ' ', { xtype : 'textfield', width : '120', id : 'q_dept' },
'->', { xtype : 'button', text: '搜索', iconCls : 'page_find', handler : doQuery }
];[/color]

var yourGrid = new Ext.grid.GridPanel({
bodyStyle : 'width:100%',
viewConfig : { forceFit : true, getRowClass : lineColor },
columns : cm,
store : ds,
loadMask : { msg : '操作中......' },
stripeRows : true,
border : false,
autoExpandColumn : 'memo',
[color=red]tbar : searchBar[/color]
});

[color=red]yourGrid.on("render", function(){
tbar2 = new Ext.Toolbar({
renderTo : yourGrid.tbar,
items : ['two', '-', {
text : 'search',
iconCls : 'search'
}, '-']
});
})[/color]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值