位置: 编程技术 - 正文

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

  • 企业所得税税前扣除管理办法
  • 预缴增值税附加税需要计提吗
  • 增值税属于哪个部门
  • 政府返还的个税怎么算
  • 总分机构是什么
  • 员工上下班交通安全培训
  • 招待用烟的会计处理
  • 无形资产减值准备
  • 其他应收款 应收账款
  • 收入费用类科目结转至本年利润
  • 房屋租赁税费征收的时间是多久
  • 拿到农产品0税率的发票可以抵扣吗
  • 公司购买灯具的会计分录
  • 外贸企业进项税额
  • 微信收入与支出是怎么算的
  • 销售黄金的会计分录
  • 餐饮发票可以计入什么费用
  • php require的用法
  • 一借多贷的会计分录怎么写
  • 增值税检查调整科目还在用吗
  • 企业实际发生的经济业务事项都需要
  • 旧房屋转卖的协议怎么写
  • 固定资产非正常中断没超过三个月
  • realsense d415参数
  • zend框架教程
  • 公司登记注册费每年都要交吗
  • 增值税留抵抵欠流程
  • Web渗透测试新手实操详解
  • 研发费用怎样进项抵扣
  • 前端微信小程序支付功能怎么实现
  • php反射机制实现自动依赖注入
  • php_curl.dll
  • php连接mysql8.0
  • 电池成本什么时候能降低
  • php中命名空间的路径
  • 完善固定资产管理的方案
  • 利息收入属于什么要素
  • 小规模需要申报吗?
  • 单位购买防疫物资会议纪要
  • 计提的坏账准备计入什么科目
  • sql中drop的用法
  • 税款追征期三年
  • 办理税务登记变更委托书怎么写
  • 免征增值税政策的政策有哪些?
  • 劳务派遣公司开票内容写什么
  • 应收账款余额在借方还是贷方
  • 税控盘买了怎么用
  • 再保后赔款支出
  • 建安企业用什么会计制度
  • 制造费用最终去哪里了啊
  • 公司贷款直接打收据吗
  • 免费品尝活动广告语
  • 收到工程款怎么入账
  • 金税盘的初始密码一般是多少
  • 冲销以前年度多计提的折旧
  • linux内核构成
  • win7系统突然退化
  • 2003怎么创建用户
  • ubuntu系统安装报错
  • 联想电脑的样子
  • win8.1 build9600
  • 备份ubuntu系统
  • win7系统桌面右键没有个性化
  • win7误删我的文档
  • 电脑没有网络连接怎么办
  • opengl做简单的模型
  • jquery添加css样式
  • qt for 安卓
  • unity小例子
  • js生成d.ts
  • python中生成随机小数的函数
  • iframe隐藏页面内容
  • js创建一个对象,里面有属性和方法
  • jQuery的ajax和遍历数组json实例代码
  • python的argparse用法
  • 深圳国税局官网
  • ca证书登录不了网厅怎么办
  • 福建 退休
  • 车船发票什么样子
  • 2021年税务高雅春联带横批
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设