
Extjs
onlydo
这个作者很懒,什么都没留下…
展开
-
Extjs 继承的使用
Javascript原始的继承写法:[code="javascript"]// Traditional constructor:Ext.Foo = function(config){ // call superclass constructor: Ext.Foo.superclass.constructor.call(this, config); this.ad...2009-04-17 14:58:55 · 93 阅读 · 0 评论 -
定制事件
http://www.extjs.com/learn/Tutorial:Events_Explained参考样例:[code="js"]OrgChart = Ext.extend(Ext.Panel, { initComponent:function() { // call parent init component OrgChart.su...2010-02-23 11:06:53 · 109 阅读 · 0 评论 -
grid render
备忘:[code="js"]{ header :"操作", dataIndex :"topas", renderer : function(value, p, r) { var rtStr = ''; if (r.data.status == '已发布') ...2010-02-25 10:39:07 · 324 阅读 · 0 评论 -
simplestore获取指定值
设置id:0,则数据中第一列为ID列。[code="js"]var bglbStore=new Ext.data.SimpleStore({ id:0, fields: [ 'ID', 'TEXT' ], data: [['-1', '全部类别'], ['501', ...2010-02-25 11:17:23 · 220 阅读 · 0 评论 -
gridpanel固定列宽
当gridpanel在viewport里面的时候,即使设置了列的width也没法固定。权宜之计,让列宽固定(fixed:true)[code="js"]cm : new Ext.grid.ColumnModel([{ header : '报告日期', dataIndex : 'JZRQ', width:100, fixed:true, sortabl...2010-02-25 17:30:53 · 275 阅读 · 0 评论 -
让toolbar的按钮像个按钮
参考这个地址的做法:http://www.extjs.com/forum/showthread.php?t=50603修改之后,将导致翻页等按钮也变成按钮样子。为了不影响其它按钮的默认样式,有以下权宜之计:先把按钮默认的cls设置成鼠标放上去的样子x-btn-over。然后添加鼠标移开的事件。删除和添加这个样式。[code="js"]{ text : '查询',...2010-02-25 18:59:51 · 135 阅读 · 0 评论 -
蛋疼的fusionchart json模式
刚在extjs里面配置使用了fusionchart,之前都使用xml模式,今天看官方发布的文档,也可以使用json,但是fusionchart使用的json极其不规范。例如用于显示K线的.[code="json"]{ "chart": { "palette": "1", "plotpriceas": "Line",原创 2011-03-09 17:28:30 · 126 阅读 · 0 评论 -
Extjs4 grid checkboxmodel
之前的写法:selModel : Ext.create('Ext.selection.CheckboxModel', {}),这个在panel关闭之后,会无法清除掉,导致再打开同一个panel的时候,复选框无法展示。Extjs4正确写法:selType:'checkboxmodel',multiSelect:true,...原创 2012-03-21 14:54:14 · 189 阅读 · 0 评论 -
键盘事件
listeners:{ scope:this, render:function(panel){ panel.el.on('keypress',function(e){ var key = e.getKey(); if( key === e.ENTER ...原创 2012-03-21 19:11:56 · 115 阅读 · 0 评论 -
grid 单击、双击处理
在initComponent末尾添加如下代码[code="js"]//单击:this.on('rowclick',function(g,i,e){ var record = g.getStore().getAt(i); alert(record.get('ID')); },this)//双击:this.on('rowdblclic...2010-04-26 16:14:39 · 225 阅读 · 0 评论 -
extjs google suggest效果
[code="js"]var stockCombo = new Ext.form.ComboBox( { store : new Ext.data.JsonStore( { idProperty : 'CODE', url : 'stockCombo.do', root : 'data', fields : [ 'CODE', 'NAME' ] })...2009-12-21 18:52:41 · 93 阅读 · 0 评论 -
extjs备忘录
1、表单获取值的方法:formPanel.form.getValues().GPDM或者:formPanel.form.findField('GPDM').getValue()2、grid日期格式化:renderer: Ext.util.Format.dateRenderer('Y-m-d')原创 2009-12-10 16:22:44 · 98 阅读 · 0 评论 -
Excanvas画图工具使用
[code="java"]var context=drawArea.getContext("2d");context.save();//这句不写,后面就没法用,我日[/code]2009-04-18 16:04:17 · 187 阅读 · 0 评论 -
服务器端输出panel代码
[code="javascript"]panel.load({ url: "your-url.php", params: {param1: "foo", param2: "bar"}, // or a URL encoded string callback: yourFunction, scope: yourObject, // optional sco...2009-04-20 11:46:23 · 121 阅读 · 0 评论 -
日期区间
首先定义vtype.[code="javascript"]Ext.apply(Ext.form.VTypes, { daterange : function(val, field) { var date = field.parseDate(val), otherFieldProp, dateProp, other; if (field.startDateField) { ...原创 2009-12-07 10:34:15 · 137 阅读 · 0 评论 -
combobox使用
页面代码:[code="javascript"]var yjjgCombo = new Ext.form.ComboBox( { fieldLabel : '研究机构', store : new Ext.data.JsonStore( { idProperty : 'ID', url : 'yjjg.do', root : 'data', fie...原创 2009-12-07 10:35:14 · 103 阅读 · 0 评论 -
附件上传方案
使用swfupload.http://swfupload.googlecode.com[code="javascript"]{ id :'uploads', xtype :'uploadDisplayField', isFormField: true, fieldLabel : '附件' }按钮事件动作如下:...原创 2009-12-07 12:25:35 · 191 阅读 · 0 评论 -
按钮列
使用Ext.ux.grid.RowActions.js,使用样例如下:[code="js"]this.rowActions = new Ext.ux.grid.RowActions({ header:'操作' ,autoWidth:false ,hideMode:'display' ,keepSelection:true ,actio...原创 2009-12-07 12:31:51 · 113 阅读 · 0 评论 -
store修改参数
store修改查询参数,如果要持久化设置参数,则需要在beforeload事件中设置,如果只是一次性参数则在store.load({params:{....}})中设置。在查询过程中,通常会因为查询结果页数不一致,所以要在查询方法后面更新一下页码pageBar.updateInfo();。以下代码备忘:[code="js"]store.on('beforeload', function...原创 2009-12-10 15:29:42 · 191 阅读 · 0 评论 -
extjs的几个技巧(转)
最近也终于使用ext做了一个小的web项目。第一次使用ext做项目毕竟经验不足,仅记下一些开发思路和需要注意的地方。 Ext Js 2.2+Spring 2.5,没有使用struts,hibernate 1)目录结构 a)js部分根目录下建立/js/ext/目录,存放所有和ext相关的js文件。/js/ext/目录下可建立ext相关子目录/j...原创 2009-12-10 15:40:50 · 147 阅读 · 0 评论 -
Ext.Img添加点击事件
var image=Ext.create('Ext.Img',{ src:'xrModule.do?method=view&id='+nodeData.nodeId, autoEl:'div',// constrain: true,// floating:true, nodeId:nodeData.nodeId, x : nodeData.x, ...原创 2012-03-25 16:44:34 · 704 阅读 · 0 评论