位置: 编程技术 - 正文

ExtJS下grid的一些属性说明(expand.grid函数)

编辑:rootadmin
1.界面修改(css style): Extjs中界面风格与我们产品本身的风格有很大不同,从边框、选中行的颜色到鼠标移动到的行的颜色、菜单等,几乎都不同。Extjs对这些样式的设置都是由css完成的。如: 选中行的颜色就可用如下设置完成: .x-grid3-row-selected{background:#c6e2ff!important;} 其他的都类似,只要找到对应的class, 然后设置要修改的部分即可。 2. 属性的作用(About Ext.grid. GroupingView, EditorGridPanel): Extjs的grid功能强大,如排序、隐藏列或移动列等,这些都有一些属性与其对应,可以选择要还是不要。其中一些的属性和其作用如下: *. EditorGridPanel: border: false, //grid的边界 autoHeight: true, //grid的高度是否要用指定的高度 enableColumnMove: false, //grid的列是否可以移动 enableHdMenu: false, //在列的header是否要有下拉菜单 trackMouseOver: true, //当鼠标移过行时,行是否要highlight stripeRows: true, //让grid相邻两行背景色不同 *. GroupingView: 在要显示的数据中,根据它们的某个数据点进行分组,分组显示。这个数据点由*.GroupingStore中的groupField决定。*.GroupingView设置这个分组显示的grid的一些关于组的显示属性。如: forceFit:true, //是否根据grid的宽度调整列的宽度,防止水平scrollbar的出现 enableGroupingMenu: false, //控制header的下拉菜单中是否有group的选项(Group By This Field, Show in Groups(checkbox)) showGroupName: true, //用来分组的数据点这一列的header是否要随group name一起显示 hideGroupedColumn: true, //用来分组的数据点这一列是否要显示 startCollapsed: false, //一开始进到grid这页,它的group是合起还是展开 scrollOffset: -1, //为垂直的scrollbar留下的space(默认是px) 3.在单元格中添加图片: 在Ext.grid.ColumnModel中对应于加图片的列,用它的render链接到一个函数进行添加。如: var colModel = new Ext.grid.ColumnModel([ {header:”com”, render: AddImgs.createDelegate(this)}, {header:”test”, width:, sortable:false} ]); 响应函数如下: AddImgs = function(value,p,record){ if(record.data.descrip != "") { p.attr='ext:qtip="Add to playlist" style="background-image:url(/imgs/icn_view.gif) !important; background-position: center 2px; background-repeat: no-repeat;cursor: pointer;"'; } } 函数中的record.data是grid的数据,而着色的就是要添加的图片的路径和图片名。 4.当显示内容的字数超过单元格可以显示的字数时,如何让其自动换行(how to wrap text when the length of characters is more than the width of the column): 设置这些单元格的所用类的css即可。 如: .x-grid3-cell-inner{ white-space:normal; overflow:visible; } 需要注意的是:overflow的默认值是hidden. 当加上white-space之后,本来wrap就可以了,但是单元格的高度还是一行的高度,所以数据除了第一行,其它都看不到。只有把overflow的值改为visible后,单元格所在行的高度才会随着数据的行数而调整。 5.当一开始进入页面时,让所有的group除了第一个group展开(collapsed)外,其它的group都合上(folded): 首先通过设置属性startCollapsed让所有group都合上: startCollapsed:true; 然后在store.load({callback: function(records,o,s) {ToggleFirstGroup();} })中调用函数把第一个group展开: //gridView是该grid所用的view, 如(var gv = new Ext.grid.GroupingView({});). 6.date format: 数据为9// 1).这种format的结果是:Web Sep :: UTC+ { header: dHeader, width: , sortable: true, dateFormat: 'Y-m-d', //dateFormat是'm/d/Y'的话,得到的结果一样 dataIndex: 'date' }, 2). 这种format的结果是: -- { header: dHeader, width: , sortable: true, renderer: Ext.util.Format.dateRenderer('Y-m-d'), //format是'm/d/Y',结果是”//” dataIndex: 'date' }, 找到的一些关于Class Date的format及其输出的描述( **************************** Format Output Description ------ ---------- -------------------------------------------------------------- d Day of the month, 2 digits with leading zeros D Wed A textual representation of a day, three letters j Day of the month without leading zeros l Wednesday A full textual representation of the day of the week S th English ordinal day of month suffix, 2 chars (use with j) w 3 Numeric representation of the day of the week z 9 The julian date, or day of the year (0-) W ISO- 2-digit week number of year, weeks starting on Monday (-) F January A full textual representation of the month m Numeric representation of a month, with leading zeros M Jan Month name abbreviation, three letters n 1 Numeric representation of a month, without leading zeros t Number of days in the given month L 0 Whether it's a leap year (1 if it is a leap year, else 0) Y A full numeric representation of a year, 4 digits y A two digit representation of a year a pm Lowercase Ante meridiem and Post meridiem A PM Uppercase Ante meridiem and Post meridiem g 3 -hour format of an hour without leading zeros G -hour format of an hour without leading zeros h -hour format of an hour with leading zeros H -hour format of an hour with leading zeros i Minutes with leading zeros s Seconds, with leading zeros O - Difference to Greenwich time (GMT) in hours T CST Timezone setting of the machine running the code Z - Timezone offset in seconds (negative if west of UTC, positive if east) ********************************** 下面是一些format的格式及其对应结果:数据同上,用renderer: Ext.util.Format.dateRenderer(format) “Y-m-d” --> -- “y-m-d” --> -- “F j, Y” --> September , “F j, y” --> September , “F j, Y, g:i A” --> September , , : AM

推荐整理分享ExtJS下grid的一些属性说明(expand.grid函数),希望有所帮助,仅作参考,欢迎阅读内容。

ExtJS下grid的一些属性说明(expand.grid函数)

文章相关热门搜索词:expand.grid函数,ext.grid,ext.grid.editorgridpanel,ext.grid.gridpanel,ext.grid.editorgridpanel,ext.grid.panel,ext.grid.panel,ext.grid,内容如对您有帮助,希望把文章链接给更多的朋友!

extJs 常用到的增,删,改,查操作代码 %@pagelanguage="java"import="java.util.*"pageEncoding="UTF-8"%htmlheadtitleextJs中常用到的增删改查操作的示例代码/title!--CommonJs.jsp为ExtJS引入的路径--%@includefile="../extJs/Co

Extjs学习笔记之一 初识Extjs之MessageBox 在其中新建一个my目录,以后所有的样例文件都新建在这个目录中。1.Helloworld!先看一个Extjs版的HelloWorld网页的全部代码:htmlheadtitleExtjsMessageBox/titlelinkrel

Extjs学习笔记之二 初识Extjs之Form Extjs中的表单组件是Ext.form.BasicForm,不过最简单最常用的是Ext.form.FormPanel控件,它继承自Panel,具有一定的界面显示控制能力,它其中包含着一个BasicForm

标签: expand.grid函数

本文链接地址:https://www.jiuchutong.com/biancheng/370218.html 转载请保留说明!

上一篇:extJs 文本框后面加上说明文字+下拉列表选中值后触发事件(文本框后缀)

下一篇:EXT中xtype的含义分析(exceltype函数的用法)

  • 进口环节消费税需要自行申报吗
  • 软件使用权收入怎么计算
  • 分公司是否可以参与投标招标
  • 利润率多少才是正常的
  • 待抵扣进项税额转出会计分录
  • 小规模纳税人季报还是月报?
  • 借款超期不还利息的法律规定
  • 员工异地缴纳社保协议
  • 企业贷款发生的利息、手续费
  • 没办税务登记公示怎么办
  • 联营企业的持股比例
  • 让渡资产使用权是指资产的所有者将
  • 协议报价税率与开出的发票不一致怎么办?
  • 出口业务具体流程图
  • 补缴税款罚款
  • 房产印花税缴纳
  • 住宿费增值税怎么算
  • 小微企业超过300万企业所得税
  • 季度缴纳所得税如何做账
  • 国有资产无偿划转实施方案
  • 企业所得税每季度申报时间
  • 收到投资款现金流量项目是什么
  • 暂估入库库存出现负数怎么办?
  • 企业资产利润率计算公式
  • 销售产品的成本属于什么科目
  • 超市预付卡发票怎么开
  • 营改增后视同销售的税务处理怎么做?
  • 华为鸿蒙os2.0发布
  • 苹果电脑怎么升级系统到最新版本
  • 费用报销流程怎么走
  • 旅行社开的发票怎么入账
  • 购买商城购买化肥
  • linux查看磁盘空间 命令fdisk
  • setlang.exe - setlang是什么进程 有什么用
  • 无法偿还应付账款账务处理
  • php+jQuery+Ajax实现点赞效果的方法(附源码下载)
  • thinkphp怎么运行
  • 国内旅客运输服务普票可以抵扣吗
  • HTML+CSS+JS+Jquery+练手项目+...合集(前端学习必备,持续更新中...)
  • 微软的人工智能ChatGPT
  • chatto
  • php微信公众账号是什么
  • 建筑行业预交增值税税率是多少
  • 个体户做账流程新手必看
  • 企业补助怎么做会计分录
  • 金蝶利润表出现科目
  • sql如何查询某个表的列名
  • 利润表中其他业务利润怎么算
  • 自产产品用于业务招待费
  • 职工食堂费列入哪里
  • 建筑业的人工费是什么
  • 别人借我的对公账户打钱
  • 亏损合同预计负债
  • 补缴税务滞纳金
  • 增值税购进扣税法
  • 公司注销剩余的存货怎么处理
  • 工会经费怎么申报,怎么上交?
  • win8.1怎么关闭更新
  • win10应用商店应用少
  • Win10 Mobile 10572怎么更新升级? 需回滚到WP 8.1
  • window10声音自动减小
  • xp系统如何设置用户密码
  • centos发送http请求
  • w7系统怎么添加打印机
  • win102021年1月大更新
  • windowsxp右键没反应
  • linux sort命令参数及用法详解
  • 蓝屏错误疑难解答win7
  • xp系统升级成win7还会卡吗
  • VS2012中C++,#include无法打开源文件
  • node.js连接数据库的代码
  • python 对象函数
  • unity3d制作ui
  • vue router 传参
  • 深入了解工作优势怎么回答
  • 魅蓝notezol
  • node exit
  • jquery遍历object
  • 使用JQuery中的trim()方法去掉前后空格
  • 深入理解中国式现代化
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设