位置: 编程技术 - 正文

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

  • 哪些支出可以税前扣除
  • 增值税申报表如何打印
  • 收客户刷卡手续费时客户不愿意缴费,如何处理
  • 出口合同包括哪些条款
  • 卖出看跌期权的损益图
  • 会计忘记申报税款会有什么影响
  • 劳务报酬增值税和个人所得税都要交吗
  • 金税维护费申报表
  • 旅游企业增值税优惠政策
  • 国有企业业务招待费管理办法
  • 商场采用联营方式的原因
  • 商家促销怎么做
  • 流动比率与速动比率之差等于现金比率
  • 公司没有缴纳住房公积金离职能要求补缴吗
  • 公司一般户走账要交税吗
  • 深圳风险程度
  • 企业必须要掌握哪些技能
  • 经营用的固定资产
  • 物业公司的跨期收费如何确认收入?
  • 未分配利润为负的原因
  • 股东利润分配预缴税款
  • 小规模纳税人公司注销流程及费用
  • 投资预算的编制方法
  • linux中nano什么指令
  • 商品房缴纳维修基金的规定
  • 情人节海报怎么画简单
  • 固定资产核销是资产损失吗
  • 公司出售已经提完折旧的机器
  • 使用的英文
  • 委托加工业务的组成计税价格
  • 出现又离开
  • 自然保护绘画
  • 跨年庆典中燃放的歌曲
  • 核定征收的企业所得税怎么算
  • vue中的proxy代理
  • watch监听不到props数据改变
  • 2023年美赛春季赛成绩查询
  • 2021所得税季报怎么填
  • java中通配符作用
  • 企业所得税汇算清缴时间
  • 所得税季度申报表怎么填
  • 民办学校学费收现金
  • 专利银行汇款操作步骤
  • 半成品结转成品会计分录
  • 一次还本付息债券定价公式
  • sql语句清空表中数据
  • 生产成本帐
  • 企业每个季度叫什么
  • 补缴税款计入什么科目
  • 销售折让的会计分录怎么做
  • 购买税控盘费用能全额抵扣吗
  • 权益净利率计算公式产权比率
  • 免增增值税的有
  • 企业职工薪酬如何确定
  • 可以先注销银行信用卡吗
  • 购方收到红字发票怎么开
  • 个税抵扣项目是什么
  • 总结下半年工作计划
  • 如何win8.1升级win10正式版
  • 如何下载苹果图书
  • ubuntu15.04安装教程
  • mac os图片
  • ubuntu怎么切换到桌面
  • Win7系统启动盘
  • linux限速
  • scm是啥
  • win7安装flash提示连接失败
  • 双win系统怎么删除一个
  • 应用web标准实例是什么
  • python创建二维数据表
  • 简述python语言
  • JavaScript html5 canvas绘制时钟效果(二)
  • jquery触发点击操作
  • 批处理列出文件名
  • javascript下拉列表怎么做
  • jquery调用iframe中的方法
  • python遍历文件
  • 广东地方税务局官网
  • 地税怎么交税
  • 税收优惠政策有没有政府补助
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设