1. #71
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    You can only call updateHeaders after the grid view has rendered.
    Code:
    if (grid.getView().innerHd) {
      grid.getView().updateHeaders();
    }

  2. #72
    Sencha User
    Join Date
    Sep 2010
    Posts
    58
    Vote Rating
    0
    ser is on a distinguished road

      0  

    Default


    Now i get it. Thanks.

    By the way, do not tell me, this table should be created with this plugin, or i can create with the usual headers and then add rows yourself and fill it out and call updateHeaders. I just have to update GroupHeader only if the table is initialized with this plugin

  3. #73
    Sencha Premium Member
    Join Date
    Mar 2007
    Posts
    39
    Vote Rating
    0
    rmesser is on a distinguished road

      0  

    Default clicking grouped headers doesn't trigger click or headerclick events

    clicking grouped headers doesn't trigger click or headerclick events


    I'm using the ColumnHeaderGroup ux as provided in the 3.3.1 examples directory, and generally speaking it works very well. However, in my app I need to detect when a user clicks one of these group headers, and I've noticed a problem in that clicking the headers doesn't trigger either a "click" or a "headerclick" event.

    To see what I mean you can start with the example at examples/grid/ColumnHeaderGroup.html. Then edit column-header-group.js to add the following listeners to the grid config (right after the "plugins: group" line):

    Code:
    	listeners: {
    	   click: function() {console.log('got click', arguments)},
    	   headerclick: function() {console.log('got headerclick', arguments)}
    	}
    Clicking around in the grid triggers the click event as expected, and clicking the bottom row of headers also triggers the headerclick event. But clicking the group headers does nothing at all.

    Any ideas on why this is or how to make it trigger the expected events?

  4. #74
    Sencha User
    Join Date
    Sep 2010
    Posts
    58
    Vote Rating
    0
    ser is on a distinguished road

      0  

    Default


    i'm using
    GroupHeaderPlugin-1.4.zip from this topic(first page) and everything works fine

  5. #75
    Sencha Premium Member
    Join Date
    Mar 2007
    Posts
    39
    Vote Rating
    0
    rmesser is on a distinguished road

      0  

    Default


    @ser, what version of ext are you using? I get an error using the GroupHeaderPlugin-1.4.zip files with extjs 3.3.1, although I haven't investigated much.

    @Condor -- isn't the ColumnGroupHeader.js plug found in the examples/grid directory now the latest and greatest version? That's what I'm using when I get the problem with click and headerclick events.

  6. #76
    Sencha User
    Join Date
    Sep 2010
    Posts
    58
    Vote Rating
    0
    ser is on a distinguished road

      0  

    Default


    3.2.1

  7. #77
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    For Ext 3.1 and up you should be using the version from the ext/examples/ux directory.

  8. #78
    Sencha User
    Join Date
    Jan 2008
    Location
    CA
    Posts
    47
    Vote Rating
    0
    Ant1105 is on a distinguished road

      0  

    Question ExtJS 4?

    ExtJS 4?


    Condor, any plans for an ExtJS 4 release of this plugin?

  9. #79
    Sencha User
    Join Date
    Sep 2010
    Posts
    51
    Vote Rating
    2
    ExTriqui is on a distinguished road

      0  

    Default Hiding/showing columns broken when using GroupingView and summaries.

    Hiding/showing columns broken when using GroupingView and summaries.


    I cannot make it work with GroupingView.
    The column widths get messed up if you use a GroupingView with this plugin and GroupSummary or GridSummary and start to hide/show columns, cause the events chain is not called in the right order.
    I think it's a problem with the events being added as prototype functions in the viewConfig instead of using view.afterMethod("onColumn...") or something like that. I'm not an expert, so if someone could help me fix this I would really appreciate it.

  10. #80
    Sencha User
    Join Date
    Sep 2010
    Posts
    51
    Vote Rating
    2
    ExTriqui is on a distinguished road

      0  

    Default I fixed the problem with summaries' width

    I fixed the problem with summaries' width


    In order to let classes inheriting from GridView update column widths properly, you have to avoid overriding some of its methods:
    Code:
    Ext.ux.grid.ColumnHeaderGroup.override({
    	init: function(grid){
    		Ext.applyIf(grid.colModel, this.config);
    		Ext.apply(grid.getView(), this.viewConfig);
    		var v = grid.getView();
    		v.afterMethod('onColumnWidthUpdated', this.updateGroupStyles, v);
    		v.afterMethod('onAllColumnWidthsUpdated', this.updateGroupStyles, v);
    		v.afterMethod('onColumnHiddenUpdated', this.updateGroupStyles, v);
    	},
    
    	viewConfig: {
    		initTemplates: function(){
    			this.constructor.prototype.initTemplates.apply(this, arguments);
    			var ts = this.templates || {};
    			if(!ts.gcell){
    				ts.gcell = new Ext.XTemplate('<td class="x-grid3-hd x-grid3-gcell x-grid3-td-{id} ux-grid-hd-group-row-{row} {cls}" style="{style}">', '<div {tooltip} class="x-grid3-hd-inner x-grid3-hd-{id}" unselectable="on" style="{istyle}">', this.grid.enableHdMenu ? '<a class="x-grid3-hd-btn" href="#"></a>' : '', '{value}</div></td>');
    			}
    			this.templates = ts;
    			this.hrowRe = new RegExp("ux-grid-hd-group-row-(\\d+)", "");
    		},
    
    		renderHeaders: function(){
    			var ts = this.templates, headers = [], cm = this.cm, rows = cm.rows, tstyle = 'width:' + this.getTotalWidth() + ';';
    
    			for(var row = 0, rlen = rows.length; row < rlen; row++){
    				var r = rows[row], cells = [];
    				for(var i = 0, gcol = 0, len = r.length; i < len; i++){
    					var group = r[i];
    					group.colspan = group.colspan || 1;
    					var id = this.getColumnId(group.dataIndex ? cm.findColumnIndex(group.dataIndex) : gcol), gs = Ext.ux.grid.ColumnHeaderGroup.prototype.getGroupStyle.call(this, group, gcol);
    					cells[i] = ts.gcell.apply({
    						cls: 'ux-grid-hd-group-cell',
    						id: id,
    						row: row,
    						style: 'width:' + gs.width + ';' + (gs.hidden ? 'display:none;' : '') + (group.align ? 'text-align:' + group.align + ';' : ''),
    						tooltip: group.tooltip ? (Ext.QuickTips.isEnabled() ? 'ext:qtip' : 'title') + '="' + group.tooltip + '"' : '',
    						istyle: group.align == 'right' ? 'padding-right:16px' : '',
    						btn: this.grid.enableHdMenu && group.header,
    						value: group.header || '&nbsp;'
    					});
    					gcol += group.colspan;
    				}
    				headers[row] = ts.header.apply({
    					tstyle: tstyle,
    					cells: cells.join('')
    				});
    			}
    			headers.push(this.constructor.prototype.renderHeaders.apply(this, arguments));
    			return headers.join('');
    		},
    /*
    		onColumnWidthUpdated: function(){
    			this.constructor.prototype.onColumnWidthUpdated.apply(this, arguments);
    			Ext.ux.grid.ColumnHeaderGroup.prototype.updateGroupStyles.call(this);
    		},
    
    		onAllColumnWidthsUpdated: function(){
    			this.constructor.prototype.onAllColumnWidthsUpdated.apply(this, arguments);
    			Ext.ux.grid.ColumnHeaderGroup.prototype.updateGroupStyles.call(this);
    		},
    
    		onColumnHiddenUpdated: function(){
    			this.constructor.prototype.onColumnHiddenUpdated.apply(this, arguments);
    			Ext.ux.grid.ColumnHeaderGroup.prototype.updateGroupStyles.call(this);
    		},
    */
    		getHeaderCell: function(index){
    			return this.mainHd.query(this.cellSelector)[index];
    		},
    
    		findHeaderCell: function(el){
    			return el ? this.fly(el).findParent('td.x-grid3-hd', this.cellSelectorDepth) : false;
    		},
    
    		findHeaderIndex: function(el){
    			var cell = this.findHeaderCell(el);
    			return cell ? this.getCellIndex(cell) : false;
    		},
    
    		updateSortIcon: function(col, dir){
    			var sc = this.sortClasses, hds = this.mainHd.select(this.cellSelector).removeClass(sc);
    			hds.item(col).addClass(sc[dir == "DESC" ? 1 : 0]);
    		},
    
    		handleHdDown: function(e, t){
    			var el = Ext.get(t);
    			if(el.hasClass('x-grid3-hd-btn')){
    				e.stopEvent();
    				var hd = this.findHeaderCell(t);
    				Ext.fly(hd).addClass('x-grid3-hd-menu-open');
    				var index = this.getCellIndex(hd);
    				this.hdCtxIndex = index;
    				var ms = this.hmenu.items, cm = this.cm;
    				ms.get('asc').setDisabled(!cm.isSortable(index));
    				ms.get('desc').setDisabled(!cm.isSortable(index));
    				this.hmenu.on('hide', function(){
    					Ext.fly(hd).removeClass('x-grid3-hd-menu-open');
    				}, this, {
    					single: true
    				});
    				this.hmenu.show(t, 'tl-bl?');
    			}else if(el.hasClass('ux-grid-hd-group-cell') || Ext.fly(t).up('.ux-grid-hd-group-cell')){
    				e.stopEvent();
    			}
    		},
    
    		handleHdMove: function(e, t){
    			var hd = this.findHeaderCell(this.activeHdRef);
    			if(hd && !this.headersDisabled && !Ext.fly(hd).hasClass('ux-grid-hd-group-cell')){
    				var hw = this.splitHandleWidth || 5, r = this.activeHdRegion, x = e.getPageX(), ss = hd.style, cur = '';
    				if(this.grid.enableColumnResize !== false){
    					if(x - r.left <= hw && this.cm.isResizable(this.activeHdIndex - 1)){
    						cur = Ext.isAir ? 'move' : Ext.isWebKit ? 'e-resize' : 'col-resize'; // col-resize
    																								// not
    																								// always
    																								// supported
    					}else if(r.right - x <= (!this.activeHdBtn ? hw : 2) && this.cm.isResizable(this.activeHdIndex)){
    						cur = Ext.isAir ? 'move' : Ext.isWebKit ? 'w-resize' : 'col-resize';
    					}
    				}
    				ss.cursor = cur;
    			}
    		},
    
    		handleHdOver: function(e, t){
    			var hd = this.findHeaderCell(t);
    			if(hd && !this.headersDisabled){
    				this.activeHdRef = t;
    				this.activeHdIndex = this.getCellIndex(hd);
    				var fly = this.fly(hd);
    				this.activeHdRegion = fly.getRegion();
    				if(!(this.cm.isMenuDisabled(this.activeHdIndex) || fly.hasClass('ux-grid-hd-group-cell'))){
    					fly.addClass('x-grid3-hd-over');
    					this.activeHdBtn = fly.child('.x-grid3-hd-btn');
    					if(this.activeHdBtn){
    						this.activeHdBtn.dom.style.height = (hd.firstChild.offsetHeight - 1) + 'px';
    					}
    				}
    			}
    		},
    
    		handleHdOut: function(e, t){
    			var hd = this.findHeaderCell(t);
    			if(hd && (!Ext.isIE || !e.within(hd, true))){
    				this.activeHdRef = null;
    				this.fly(hd).removeClass('x-grid3-hd-over');
    				hd.style.cursor = '';
    			}
    		},
    
    		handleHdMenuClick: function(item){
    			var index = this.hdCtxIndex, cm = this.cm, ds = this.ds, id = item.getItemId();
    			switch(id){
    				case 'asc':
    					ds.sort(cm.getDataIndex(index), 'ASC');
    					break;
    				case 'desc':
    					ds.sort(cm.getDataIndex(index), 'DESC');
    					break;
    				default:
    					if(id.substr(0, 6) == 'group-'){
    						var i = id.split('-'), row = parseInt(i[1], 10), col = parseInt(i[2], 10), r = this.cm.rows[row], group, gcol = 0;
    						for(var i = 0, len = r.length; i < len; i++){
    							group = r[i];
    							if(col >= gcol && col < gcol + group.colspan){
    								break;
    							}
    							gcol += group.colspan;
    						}
    						if(item.checked){
    							var max = cm.getColumnsBy(this.isHideableColumn, this).length;
    							for(var i = gcol, len = gcol + group.colspan; i < len; i++){
    								if(!cm.isHidden(i)){
    									max--;
    								}
    							}
    							if(max < 1){
    								this.onDenyColumnHide();
    								return false;
    							}
    						}
    						for(var i = gcol, len = gcol + group.colspan; i < len; i++){
    							if(cm.config[i].fixed !== true && cm.config[i].hideable !== false){
    								cm.setHidden(i, item.checked);
    							}
    						}
    					}else if(id.substr(0, 4) == 'col-'){
    						index = cm.getIndexById(id.substr(4));
    						if(index != -1){
    							if(item.checked && cm.getColumnsBy(this.isHideableColumn, this).length <= 1){
    								this.onDenyColumnHide();
    								return false;
    							}
    							cm.setHidden(index, item.checked);
    						}
    					}
    					if(id.substr(0, 6) == 'group-' || id.substr(0, 4) == 'col-'){
    						item.checked = !item.checked;
    						if(item.menu){
    							var updateChildren = function(menu){
    								menu.items.each(function(childItem){
    									if(!childItem.disabled){
    										childItem.setChecked(item.checked, false);
    										if(childItem.menu){
    											updateChildren(childItem.menu);
    										}
    									}
    								});
    							};
    							updateChildren(item.menu);
    						}
    						var parentMenu = item, parentItem;
    						while(parentMenu = parentMenu.parentMenu){
    							if(!parentMenu.parentMenu || !(parentItem = parentMenu.parentMenu.items.get(parentMenu.getItemId())) || !parentItem.setChecked){
    								break;
    							}
    							var checked = parentMenu.items.findIndexBy(function(m){
    								return m.checked;
    							}) >= 0;
    							parentItem.setChecked(checked, true);
    						}
    						item.checked = !item.checked;
    					}
    			}
    			return true;
    		},
    
    		beforeColMenuShow: function(){
    			var cm = this.cm, rows = this.cm.rows;
    			this.colMenu.removeAll();
    			for(var col = 0, clen = cm.getColumnCount(); col < clen; col++){
    				var menu = this.colMenu, title = cm.getColumnHeader(col), text = [];
    				if(cm.config[col].fixed !== true && cm.config[col].hideable !== false){
    					for(var row = 0, rlen = rows.length; row < rlen; row++){
    						var r = rows[row], group, gcol = 0;
    						for(var i = 0, len = r.length; i < len; i++){
    							group = r[i];
    							if(col >= gcol && col < gcol + group.colspan){
    								break;
    							}
    							gcol += group.colspan;
    						}
    						if(group && group.header){
    							if(cm.hierarchicalColMenu){
    								var gid = 'group-' + row + '-' + gcol,
    									item = menu.items ? menu.getComponent(gid) : null,
    									submenu = item ? item.menu : null;
    								if(!submenu){
    									submenu = new Ext.menu.Menu({
    										itemId: gid
    									});
    									submenu.on("itemclick", this.handleHdMenuClick, this);
    									var checked = false, disabled = true;
    									for(var c = gcol, lc = gcol + group.colspan; c < lc; c++){
    										if(!cm.isHidden(c)){
    											checked = true;
    										}
    										if(cm.config[c].hideable !== false){
    											disabled = false;
    										}
    									}
    									menu.add({
    										itemId: gid,
    										text: group.header,
    										menu: submenu,
    										hideOnClick: false,
    										checked: checked,
    										disabled: disabled
    									});
    								}
    								menu = submenu;
    							}else{
    								text.push(group.header);
    							}
    						}
    					}
    					text.push(title);
    					menu.add(new Ext.menu.CheckItem({
    						itemId: "col-" + cm.getColumnId(col),
    						text: text.join(' '),
    						checked: !cm.isHidden(col),
    						hideOnClick: false,
    						disabled: cm.config[col].hideable === false
    					}));
    				}
    			}
    		},
    
    		afterRenderUI: function(){
    			this.constructor.prototype.afterRenderUI.apply(this, arguments);
    			Ext.apply(this.columnDrop, Ext.ux.grid.ColumnHeaderGroup.prototype.columnDropConfig);
    			Ext.apply(this.splitZone, Ext.ux.grid.ColumnHeaderGroup.prototype.splitZoneConfig);
    		}
    	}
    });

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar