位置: 编程技术 - 正文

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函数的用法)

  • 年底企业所得税计提少了
  • 应纳税额减征额包括哪些内容
  • 租赁厂房对方不租怎么办
  • 整形医院有收费标准么
  • 一般纳税人附加税减免政策2023
  • 混搭销售的企业有哪些
  • 收款收据写着投诉有效吗
  • 周转材料调拨调入单位如何做账
  • 投资可赎回基金怎么入账?
  • 实收资本没到账,一直挂其他应收款,有啥影响
  • 单位购入新车的发票
  • 母子公司间的借款现金流计入哪里
  • 法人变更了还用变更发票领用本吗
  • 2021年个体工商户的税率是多少
  • 17%和6%的票能直接抵扣吗?
  • 发票认证信息怎么填
  • 运费从货款中扣除后付款分录怎么做
  • 农村合作社补贴政策
  • 事业单位专项经费包括哪些
  • 职工教育经费超过可以结转以后年度怎么做账
  • 总部资产减值测试例题
  • low是什么文件
  • Chateau de Castelnaud in Perigord, France (© Peter Adams/Offset by Shutterstock)
  • vue2.0解决跨域问题
  • vue导出word文档打开报错,内容有问题
  • 市职工报销比例多少
  • php接口技术
  • 前端 教程
  • php 注入
  • 待核销基建支出与待摊投资的区别
  • 资产支出加权平均数例题
  • 印花税计税基础含增值税
  • 进口货物交哪些税费
  • 现金流量表里的其他指的是什么
  • 公司注销税款太多
  • 织梦相关文章调用
  • 年初未分配利润在借方表示什么
  • 无偿帮工造成财产损失谁赔偿 法院
  • 上月未结账本月不能结账
  • 盈余公积转增资本所有者权益会变吗
  • 管理费用属于产品成本么
  • 清算机构收单机构和发卡行
  • 税金及附加与应交税金的关系
  • 税控盘的进项税在哪里申报
  • 上个月计提多了,这个月怎么办?
  • 我国现行资源税主要采用什么税率
  • 进项税可以跨年结转吗
  • 如果停产怎么计算成本
  • 公司验资报告多少钱
  • 不动产计提折旧时间
  • 可供分配的利润是什么意思
  • 雇主责任险为什么理赔很慢
  • 代扣代缴个人所得税分录
  • 公司出资给另一个公司
  • 进项税额转出有余额怎么调整
  • 销售佣金的会计科目
  • 设备5年直线法计提折旧怎么做?
  • 股权转让 会计
  • 设置包装盒
  • windows下mysql安装配置教程
  • MySQL replace into 语句浅析(一)
  • javaw.exe是什么进程
  • ubuntu怎么root权限
  • linux 运行二进制文件
  • iwatch命名
  • Linux编译内核无法启动
  • react-native-navigation
  • 游戏中的物理 processing
  • 逆向教程推荐知乎
  • nodejs文件操作
  • shell监控进程
  • node.js怎么用
  • python写抢购教程
  • js正则 \w
  • js教程
  • 国家税务局四川省电子税务局
  • 做好绩效管理工作税务局
  • 多计提的税金如何处理
  • 个人扣缴客户端怎样迁移信息
  • 广东可以去吗
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设