博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Extjs GridPanel 监听事件 行选中背景
阅读量:5156 次
发布时间:2019-06-13

本文共 6509 字,大约阅读时间需要 21 分钟。

 Extjs设置GridPanel选中行背景色和选中单元格背景色 

var view = grid.getView();

view.getRow(index).style.backgroundColor = "red";  //选中行背景色

view.getCell(rowIndex,colIndex).style.backgroundColor = "red";  //选中单元格背景色

我在开发时是在CheckboxSelectionModel中的beforerowselect中进行设置的:

var smQd = new Ext.grid.CheckboxSelectionModel({  'beforerowselect':function(sm,rowIndex,keepExisting,record){                           var l = storeXtcpyy.getCount();                           for(var i=0;i
gridXtcpyy.addListener('cellclick', function (grid, rowIndex, columnIndex, event) {    var view = gridXtcpyy.getView();    view.getRow(rowIndex).style.backgroundColor = "#DFE8F6";   }, gridXtcpyy);

 

var smQd = new Ext.grid.CheckboxSelectionModel({        renderer:function(value, metaData, record, rowIndex, colIndex, store){                        if((org_id == record.data['dsfjg'])||(top_org_id == org_id)){                            if((record.data['ywdm']=="901")||(record.data['xgdjzt'].split("-")[0] == 2)||(record.data['khlxzt'].split("-")[0] != 0)||(record.data['khtzzt'].split("-")[0] != 0)){                                 return "";                            }else{                                return '
'; } }else{ return ""; } }, //不允许使用点击表格形式修改选择 //handleMouseDown:Ext.emptyFn, listeners:{ /*'rowselect':function(sm,rowIndex,record){ var view = gridXtcpyy.getView(); view.getRow(rowIndex).style.backgroundColor = "#DFE8F6"; }, 'rowdeselect':function(sm,rowIndex,record){ var l = storeXtcpyy.getCount(); for(var i=0;i
0){ var select_zyed = 0; var yxt_rs = 0; for(var i=0;i
=gmqdje && parseFloat(jyje_sel) < xzje){ yxt_rs ++; } } } used_ed.setValue(rendererZhMoney(select_zyed)); //var total_ed_arr = total_ed.getValue().split(","); var total_ed_arr = Ext.getCmp("total_ed").getValue().split(","); var _total_ed = ""; for(var j = 0; j< total_ed_arr.length; j++){ _total_ed += total_ed_arr[j]; } _total_ed = parseFloat(_total_ed); var sure_used_ed_arr = Ext.getCmp("sure_used_ed").getValue().split(","); var _sure_used_ed = ""; for(var j = 0; j< sure_used_ed_arr.length; j++){ _sure_used_ed += sure_used_ed_arr[j]; } _sure_used_ed = parseFloat(_sure_used_ed); var yfdx_wqr_ed_arr = Ext.getCmp("yfdx_wqr_ed").getValue().split(","); var _yfdx_wqr_ed = ""; for(var j = 0; j< yfdx_wqr_ed_arr.length; j++){ _yfdx_wqr_ed += yfdx_wqr_ed_arr[j]; } _yfdx_wqr_ed = parseFloat(_yfdx_wqr_ed); //console.log("---------:"+Subtr(_total_ed,accAdd(accAdd(_sure_used_ed,_yfdx_wqr_ed),select_zyed))); //leave_ed.setValue(rendererZhMoney(_total_ed-_sure_used_ed-_yfdx_wqr_ed-select_zyed)); leave_ed.setValue(rendererZhMoney(Subtr(_total_ed,accAdd(accAdd(_sure_used_ed,_yfdx_wqr_ed),select_zyed)))); //leave_ed.setValue(rendererZhMoney(Subtr(total_ed,select_zyed))); total_rs = total_xje_rs.getValue(); ytz_rs = ytz_xje_rs.getValue(); yxz_xje_rs.setValue(yxt_rs); sy_xje_rs.setValue(Subtr(total_rs,accAdd(ytz_rs,yxt_rs))); }else{ used_ed.setValue(rendererZhMoney(0)); //leave_ed.setValue(total_ed.getValue()); var total_ed_arr = Ext.getCmp("total_ed").getValue().split(","); var _total_ed = ""; for(var j = 0; j< total_ed_arr.length; j++){ _total_ed += total_ed_arr[j]; } _total_ed = parseFloat(_total_ed); var sure_used_ed_arr = Ext.getCmp("sure_used_ed").getValue().split(","); var _sure_used_ed = ""; for(var j = 0; j< sure_used_ed_arr.length; j++){ _sure_used_ed += sure_used_ed_arr[j]; } _sure_used_ed = parseFloat(_sure_used_ed); var yfdx_wqr_ed_arr = Ext.getCmp("yfdx_wqr_ed").getValue().split(","); var _yfdx_wqr_ed = ""; for(var j = 0; j< yfdx_wqr_ed_arr.length; j++){ _yfdx_wqr_ed += yfdx_wqr_ed_arr[j]; } _yfdx_wqr_ed = parseFloat(_yfdx_wqr_ed); //leave_ed.setValue(rendererZhMoney(_total_ed-_sure_used_ed-_yfdx_wqr_ed)); leave_ed.setValue(rendererZhMoney(Subtr(_total_ed,accAdd(_sure_used_ed,_yfdx_wqr_ed)))); total_rs = total_xje_rs.getValue(); ytz_rs = ytz_xje_rs.getValue(); yxz_xje_rs.setValue(0); sy_xje_rs.setValue(Subtr(total_rs,ytz_rs)); } }, 'beforerowselect':function(sm,rowIndex,keepExisting,record){ var l = storeXtcpyy.getCount(); for(var i=0;i

 

转载于:https://www.cnblogs.com/mingforyou/p/3560180.html

你可能感兴趣的文章
软件工程课程-个人编程作业
查看>>
Java8内存模型—永久代(PermGen)和元空间(Metaspace)(转)
查看>>
ObjectiveC基础教程(第2版)
查看>>
centos 引导盘
查看>>
Notes of Daily Scrum Meeting(12.8)
查看>>
Apriori算法
查看>>
onlevelwasloaded的调用时机
查看>>
求出斐波那契数组
查看>>
Vue.js 基础学习之组件通信
查看>>
lr_start_transaction/lr_end_transaction事物组合
查看>>
每天一个Linux命令 - 【chkconfig】
查看>>
△UVA10106 - Product(大数乘法)
查看>>
golang (7) 文件操作
查看>>
关于 Object.defineProperty()
查看>>
[转] Maven 从命令行获取项目的版本号
查看>>
CodeIgniter学习笔记(四)——CI超级对象中的load装载器
查看>>
.NET CLR基本术语
查看>>
ubuntu的home目录下,Desktop等目录消失不见
查看>>
建立,查询二叉树 hdu 5444
查看>>
[Spring框架]Spring 事务管理基础入门总结.
查看>>