view release on metacpan or search on metacpan
share/ext/ext-all-debug.js view on Meta::CPAN
},
handleOverflow: Ext.emptyFn,
clearOverflow: Ext.emptyFn
});
Ext.layout.boxOverflow.none = Ext.layout.boxOverflow.None;
Ext.layout.boxOverflow.Menu = Ext.extend(Ext.layout.boxOverflow.None, {
afterCls: 'x-strip-right',
noItemsMenuText : '<div class="x-toolbar-no-items">(None)</div>',
constructor: function(layout) {
Ext.layout.boxOverflow.Menu.superclass.constructor.apply(this, arguments);
this.menuItems = [];
},
createInnerElements: function() {
if (!this.afterCt) {
this.afterCt = this.layout.innerCt.insertSibling({cls: this.afterCls}, 'before');
}
share/ext/ext-all-debug.js view on Meta::CPAN
return {
targetSize: {
height: targetSize.height,
width : newWidth
}
};
},
showTrigger: function() {
this.createMenu();
this.menuTrigger.show();
},
hideTrigger: function() {
if (this.menuTrigger != undefined) {
this.menuTrigger.hide();
}
},
beforeMenuShow: function(menu) {
var items = this.menuItems,
len = items.length,
item,
prev;
var needsSep = function(group, item){
return group.isXType('buttongroup') && !(item instanceof Ext.Toolbar.Separator);
};
this.clearMenu();
menu.removeAll();
for (var i = 0; i < len; i++) {
item = items[i].component;
if (prev && (needsSep(item, prev) || needsSep(prev, item))) {
menu.add('-');
}
this.addComponentToMenu(menu, item);
prev = item;
}
if (menu.items.length < 1) {
menu.add(this.noItemsMenuText);
}
},
createMenuConfig : function(component, hideOnClick){
var config = Ext.apply({}, component.initialConfig),
group = component.toggleGroup;
Ext.copyTo(config, component, [
'iconCls', 'icon', 'itemId', 'disabled', 'handler', 'scope', 'menu'
]);
Ext.apply(config, {
text : component.overflowText || component.text,
hideOnClick: hideOnClick
share/ext/ext-all-debug.js view on Meta::CPAN
}
delete config.ownerCt;
delete config.xtype;
delete config.id;
return config;
},
addComponentToMenu : function(menu, component) {
if (component instanceof Ext.Toolbar.Separator) {
menu.add('-');
} else if (Ext.isFunction(component.isXType)) {
if (component.isXType('splitbutton')) {
menu.add(this.createMenuConfig(component, true));
} else if (component.isXType('button')) {
menu.add(this.createMenuConfig(component, !component.menu));
} else if (component.isXType('buttongroup')) {
component.items.each(function(item){
this.addComponentToMenu(menu, item);
}, this);
}
}
},
clearMenu : function(){
var menu = this.moreMenu;
if (menu && menu.items) {
menu.items.each(function(item){
delete item.menu;
});
}
},
createMenu: function() {
if (!this.menuTrigger) {
this.createInnerElements();
this.menu = new Ext.menu.Menu({
ownerCt : this.layout.container,
listeners: {
scope: this,
beforeshow: this.beforeMenuShow
}
});
this.menuTrigger = new Ext.Button({
iconCls : 'x-toolbar-more-icon',
cls : 'x-toolbar-more',
menu : this.menu,
renderTo: this.afterCt
});
}
},
destroy: function() {
Ext.destroy(this.menu, this.menuTrigger);
}
});
Ext.layout.boxOverflow.menu = Ext.layout.boxOverflow.Menu;
Ext.layout.boxOverflow.HorizontalMenu = Ext.extend(Ext.layout.boxOverflow.Menu, {
constructor: function() {
Ext.layout.boxOverflow.HorizontalMenu.superclass.constructor.apply(this, arguments);
var me = this,
layout = me.layout,
origFunction = layout.calculateChildBoxes;
layout.calculateChildBoxes = function(visibleItems, targetSize) {
var calcs = origFunction.apply(layout, arguments),
meta = calcs.meta,
items = me.menuItems;
share/ext/ext-all-debug.js view on Meta::CPAN
return {
targetSize: {
height: targetSize.height,
width : newWidth
},
recalculate: recalculate
};
}
});
Ext.layout.boxOverflow.menu.hbox = Ext.layout.boxOverflow.HorizontalMenu;
Ext.layout.boxOverflow.Scroller = Ext.extend(Ext.layout.boxOverflow.None, {
animateScroll: true,
scrollIncrement: 100,
wheelIncrement: 3,
share/ext/ext-all-debug.js view on Meta::CPAN
Ext.layout.ToolbarLayout = Ext.extend(Ext.layout.ContainerLayout, {
monitorResize : true,
type: 'toolbar',
triggerWidth: 18,
noItemsMenuText : '<div class="x-toolbar-no-items">(None)</div>',
lastOverflow: false,
tableHTML: [
'<table cellspacing="0" class="x-toolbar-ct">',
'<tbody>',
'<tr>',
'<td class="x-toolbar-left" align="{0}">',
share/ext/ext-all-debug.js view on Meta::CPAN
hasHiddens = hiddenItems.length != 0;
if (hasHiddens) {
this.initMore();
if (!this.lastOverflow) {
this.container.fireEvent('overflowchange', this.container, true);
this.lastOverflow = true;
}
} else if (this.more) {
this.clearMenu();
this.more.destroy();
delete this.more;
if (this.lastOverflow) {
this.container.fireEvent('overflowchange', this.container, false);
this.lastOverflow = false;
}
}
},
createMenuConfig : function(component, hideOnClick){
var config = Ext.apply({}, component.initialConfig),
group = component.toggleGroup;
Ext.copyTo(config, component, [
'iconCls', 'icon', 'itemId', 'disabled', 'handler', 'scope', 'menu'
]);
Ext.apply(config, {
text : component.overflowText || component.text,
hideOnClick: hideOnClick
share/ext/ext-all-debug.js view on Meta::CPAN
}
delete config.ownerCt;
delete config.xtype;
delete config.id;
return config;
},
addComponentToMenu : function(menu, component) {
if (component instanceof Ext.Toolbar.Separator) {
menu.add('-');
} else if (Ext.isFunction(component.isXType)) {
if (component.isXType('splitbutton')) {
menu.add(this.createMenuConfig(component, true));
} else if (component.isXType('button')) {
menu.add(this.createMenuConfig(component, !component.menu));
} else if (component.isXType('buttongroup')) {
component.items.each(function(item){
this.addComponentToMenu(menu, item);
}, this);
}
}
},
clearMenu : function(){
var menu = this.moreMenu;
if (menu && menu.items) {
menu.items.each(function(item){
delete item.menu;
});
}
},
beforeMoreShow : function(menu) {
var items = this.container.items.items,
len = items.length,
item,
prev;
var needsSep = function(group, item){
return group.isXType('buttongroup') && !(item instanceof Ext.Toolbar.Separator);
};
this.clearMenu();
menu.removeAll();
for (var i = 0; i < len; i++) {
item = items[i];
if (item.xtbHidden) {
if (prev && (needsSep(item, prev) || needsSep(prev, item))) {
menu.add('-');
}
this.addComponentToMenu(menu, item);
prev = item;
}
}
if (menu.items.length < 1) {
menu.add(this.noItemsMenuText);
}
},
initMore : function(){
if (!this.more) {
this.moreMenu = new Ext.menu.Menu({
ownerCt : this.container,
listeners: {
beforeshow: this.beforeMoreShow,
scope: this
}
});
this.more = new Ext.Button({
iconCls: 'x-toolbar-more-icon',
cls : 'x-toolbar-more',
menu : this.moreMenu,
ownerCt: this.container
});
var td = this.insertCell(this.more, this.extrasTr, 100);
this.more.render(td);
}
},
destroy : function(){
Ext.destroy(this.more, this.moreMenu);
delete this.leftTr;
delete this.rightTr;
delete this.extrasTr;
Ext.layout.ToolbarLayout.superclass.destroy.call(this);
}
});
Ext.Container.LAYOUTS.toolbar = Ext.layout.ToolbarLayout;
Ext.layout.MenuLayout = Ext.extend(Ext.layout.ContainerLayout, {
monitorResize : true,
type: 'menu',
setContainer : function(ct){
this.monitorResize = !ct.floating;
ct.on('autosize', this.doAutoSize, this);
Ext.layout.MenuLayout.superclass.setContainer.call(this, ct);
},
renderItem : function(c, position, target){
if (!this.itemTpl) {
this.itemTpl = Ext.layout.MenuLayout.prototype.itemTpl = new Ext.XTemplate(
'<li id="{itemId}" class="{itemCls}">',
'<tpl if="needsIcon">',
'<img alt="{altText}" src="{icon}" class="{iconCls}"/>',
'</tpl>',
'</li>'
);
}
if(c && !c.rendered){
if(Ext.isNumber(position)){
share/ext/ext-all-debug.js view on Meta::CPAN
c.render(c.positionEl = position ?
this.itemTpl.insertBefore(position, a, true) :
this.itemTpl.append(target, a, true));
c.positionEl.menuItemId = c.getItemId();
if (!a.isMenuItem && a.needsIcon) {
c.positionEl.addClass('x-menu-list-item-indent');
}
this.configureItem(c);
}else if(c && !this.isValidParent(c, target)){
if(Ext.isNumber(position)){
position = target.dom.childNodes[position];
}
target.dom.insertBefore(c.getActionEl().dom, position || null);
}
},
getItemArgs : function(c) {
var isMenuItem = c instanceof Ext.menu.Item,
canHaveIcon = !(isMenuItem || c instanceof Ext.menu.Separator);
return {
isMenuItem: isMenuItem,
needsIcon: canHaveIcon && (c.icon || c.iconCls),
icon: c.icon || Ext.BLANK_IMAGE_URL,
iconCls: 'x-menu-item-icon ' + (c.iconCls || ''),
itemId: 'x-menu-el-' + c.id,
itemCls: 'x-menu-list-item ',
altText: c.altText || ''
};
},
isValidParent : function(c, target) {
return c.el.up('li.x-menu-list-item', 5).dom.parentNode === (target.dom || target);
},
onLayout : function(ct, target){
Ext.layout.MenuLayout.superclass.onLayout.call(this, ct, target);
this.doAutoSize();
},
doAutoSize : function(){
var ct = this.container, w = ct.width;
if(ct.floating){
if(w){
ct.setWidth(w);
}else if(Ext.isIE){
ct.setWidth(Ext.isStrict && (Ext.isIE7 || Ext.isIE8) ? 'auto' : ct.minWidth);
var el = ct.getEl(), t = el.dom.offsetWidth;
ct.setWidth(ct.getLayoutTarget().getWidth() + el.getFrameWidth('lr'));
}
}
}
});
Ext.Container.LAYOUTS['menu'] = Ext.layout.MenuLayout;
Ext.Viewport = Ext.extend(Ext.Container, {
share/ext/ext-all-debug.js view on Meta::CPAN
this.selected = new Ext.CompositeElementLite();
},
afterRender : function(){
Ext.DataView.superclass.afterRender.call(this);
this.mon(this.getTemplateTarget(), {
"click": this.onClick,
"dblclick": this.onDblClick,
"contextmenu": this.onContextMenu,
scope:this
});
if(this.overClass || this.trackOver){
this.mon(this.getTemplateTarget(), {
"mouseover": this.onMouseOver,
"mouseout": this.onMouseOut,
scope:this
});
}
share/ext/ext-all-debug.js view on Meta::CPAN
this.onContainerClick(e);
}
}
},
onContainerClick : function(e){
this.clearSelections();
},
onContextMenu : function(e){
var item = e.getTarget(this.itemSelector, this.getTemplateTarget());
if(item){
this.fireEvent("contextmenu", this, this.indexOf(item), item, e);
}else{
this.fireEvent("containercontextmenu", this, e);
}
},
onDblClick : function(e){
share/ext/ext-all-debug.js view on Meta::CPAN
this.setActiveTab(item);
}
},
initEvents : function(){
Ext.TabPanel.superclass.initEvents.call(this);
this.mon(this.strip, {
scope: this,
mousedown: this.onStripMouseDown,
contextmenu: this.onStripContextMenu
});
if(this.enableTabScroll){
this.mon(this.strip, 'mousewheel', this.onWheel, this);
}
},
findTargets : function(e){
var item = null,
itemEl = e.getTarget('li:not(.x-tab-edge)', this.strip);
share/ext/ext-all-debug.js view on Meta::CPAN
this.remove(t.item);
}
return;
}
if(t.item && t.item != this.activeTab){
this.setActiveTab(t.item);
}
},
onStripContextMenu : function(e){
e.preventDefault();
var t = this.findTargets(e);
if(t.item){
this.fireEvent('contextmenu', this, t.item, e);
}
},
readTabs : function(removeExisting){
if(removeExisting === true){
share/ext/ext-all-debug.js view on Meta::CPAN
arrowAlign : 'right',
initComponent : function(){
if(this.menu){
this.menu = Ext.menu.MenuMgr.get(this.menu);
this.menu.ownerCt = this;
}
Ext.Button.superclass.initComponent.call(this);
this.addEvents(
'click',
'toggle',
share/ext/ext-all-debug.js view on Meta::CPAN
if (this.menu){
this.menu.ownerCt = undefined;
}
if(Ext.isString(this.toggleGroup)){
this.enableToggle = true;
}
},
getTemplateArgs : function(){
return [this.type, 'x-btn-' + this.scale + ' x-btn-icon-' + this.scale + '-' + this.iconAlign, this.getMenuClass(), this.cls, this.id];
},
setButtonClass : function(){
if(this.useSetClass){
if(!Ext.isEmpty(this.oldCls)){
this.el.removeClass([this.oldCls, 'x-btn-pressed']);
}
this.oldCls = (this.iconCls || this.icon) ? (this.text ? 'x-btn-text-icon' : 'x-btn-icon') : 'x-btn-noicon';
this.el.addClass([this.oldCls, this.pressed ? 'x-btn-pressed' : null]);
}
},
getMenuClass : function(){
return this.menu ? (this.arrowAlign != 'bottom' ? 'x-btn-arrow' : 'x-btn-arrow-bottom') : '';
},
onRender : function(ct, position){
if(!this.template){
if(!Ext.Button.buttonTemplate){
Ext.Button.buttonTemplate = new Ext.Template(
'<table id="{4}" cellspacing="0" class="x-btn {3}"><tbody class="{1}">',
share/ext/ext-all-debug.js view on Meta::CPAN
mousedown: this.onMouseDown
});
}
if(this.menu){
this.mon(this.menu, {
scope: this,
show: this.onMenuShow,
hide: this.onMenuHide
});
}
if(this.repeat){
var repeater = new Ext.util.ClickRepeater(btn, Ext.isObject(this.repeat) ? this.repeat : {});
this.mon(repeater, 'click', this.onRepeatClick, this);
}else{
this.mon(btn, this.clickEvent, this.onClick, this);
}
},
share/ext/ext-all-debug.js view on Meta::CPAN
if(Ext.isObject(this.tooltip)){
Ext.QuickTips.unregister(this.btnEl);
}
},
beforeDestroy : function(){
if(this.rendered){
this.clearTip();
}
if(this.menu && this.destroyMenu !== false) {
Ext.destroy(this.btnEl, this.menu);
}
Ext.destroy(this.repeater);
},
onDestroy : function(){
if(this.rendered){
this.doc.un('mouseover', this.monitorMouseOver, this);
this.doc.un('mouseup', this.onMouseUp, this);
share/ext/ext-all-debug.js view on Meta::CPAN
if(this.el){
if(!Ext.isIE6 || !this.text){
this.el[disabled ? 'addClass' : 'removeClass'](this.disabledClass);
}
this.el.dom.disabled = disabled;
}
this.disabled = disabled;
},
showMenu : function(){
if(this.rendered && this.menu){
if(this.tooltip){
Ext.QuickTips.getQuickTip().cancelShow(this.btnEl);
}
if(this.menu.isVisible()){
this.menu.hide();
}
this.menu.ownerCt = this;
this.menu.show(this.el, this.menuAlign);
}
return this;
},
hideMenu : function(){
if(this.hasVisibleMenu()){
this.menu.hide();
}
return this;
},
hasVisibleMenu : function(){
return this.menu && this.menu.ownerCt == this && this.menu.isVisible();
},
onRepeatClick : function(repeat, e){
this.onClick(e);
},
onClick : function(e){
if(e){
e.preventDefault();
}
if(e.button !== 0){
return;
}
if(!this.disabled){
this.doToggle();
if(this.menu && !this.hasVisibleMenu() && !this.ignoreNextClick){
this.showMenu();
}
this.fireEvent('click', this, e);
if(this.handler){
this.handler.call(this.scope || this, this, e);
}
}
},
doToggle: function(){
if (this.enableToggle && (this.allowDepress !== false || !this.pressed)) {
this.toggle();
}
},
isMenuTriggerOver : function(e, internal){
return this.menu && !internal;
},
isMenuTriggerOut : function(e, internal){
return this.menu && !internal;
},
onMouseOver : function(e){
if(!this.disabled){
var internal = e.within(this.el, true);
if(!internal){
this.el.addClass('x-btn-over');
if(!this.monitoringMouseOver){
this.doc.on('mouseover', this.monitorMouseOver, this);
this.monitoringMouseOver = true;
}
this.fireEvent('mouseover', this, e);
}
if(this.isMenuTriggerOver(e, internal)){
this.fireEvent('menutriggerover', this, this.menu, e);
}
}
},
monitorMouseOver : function(e){
if(e.target != this.el.dom && !e.within(this.el)){
if(this.monitoringMouseOver){
this.doc.un('mouseover', this.monitorMouseOver, this);
share/ext/ext-all-debug.js view on Meta::CPAN
}
this.onMouseOut(e);
}
},
onMouseOut : function(e){
var internal = e.within(this.el) && e.target != this.el.dom;
this.el.removeClass('x-btn-over');
this.fireEvent('mouseout', this, e);
if(this.isMenuTriggerOut(e, internal)){
this.fireEvent('menutriggerout', this, this.menu, e);
}
},
focus : function() {
this.btnEl.focus();
},
blur : function() {
this.btnEl.blur();
share/ext/ext-all-debug.js view on Meta::CPAN
}
},
onMouseUp : function(e){
if(e.button === 0){
this.getClickEl(e, true).removeClass('x-btn-click');
this.doc.un('mouseup', this.onMouseUp, this);
}
},
onMenuShow : function(e){
if(this.menu.ownerCt == this){
this.menu.ownerCt = this;
this.ignoreNextClick = 0;
this.el.addClass('x-btn-menu-active');
this.fireEvent('menushow', this, this.menu);
}
},
onMenuHide : function(e){
if(this.menu.ownerCt == this){
this.el.removeClass('x-btn-menu-active');
this.ignoreNextClick = this.restoreClick.defer(250, this);
this.fireEvent('menuhide', this, this.menu);
delete this.menu.ownerCt;
}
},
restoreClick : function(){
share/ext/ext-all-debug.js view on Meta::CPAN
this.el.child(this.arrowSelector).dom[this.tooltipType] = this.arrowTooltip;
}
},
setArrowHandler : function(handler, scope){
this.arrowHandler = handler;
this.scope = scope;
},
getMenuClass : function(){
return 'x-btn-split' + (this.arrowAlign == 'bottom' ? '-bottom' : '');
},
isClickOnArrow : function(e){
if (this.arrowAlign != 'bottom') {
var visBtn = this.el.child('em.x-btn-split');
var right = visBtn.getRegion().right - visBtn.getPadding('r');
return e.getPageX() > right;
} else {
return e.getPageY() > this.btnEl.getRegion().bottom;
}
},
onClick : function(e, t){
e.preventDefault();
if(!this.disabled){
if(this.isClickOnArrow(e)){
if(this.menu && !this.menu.isVisible() && !this.ignoreNextClick){
this.showMenu();
}
this.fireEvent("arrowclick", this, e);
if(this.arrowHandler){
this.arrowHandler.call(this.scope || this, this, e);
}
}else{
this.doToggle();
this.fireEvent("click", this, e);
if(this.handler){
this.handler.call(this.scope || this, this, e);
}
}
}
},
isMenuTriggerOver : function(e){
return this.menu && e.target.tagName == this.arrowSelector;
},
isMenuTriggerOut : function(e, internal){
return this.menu && e.target.tagName != this.arrowSelector;
}
});
Ext.reg('splitbutton', Ext.SplitButton);
Ext.CycleButton = Ext.extend(Ext.SplitButton, {
share/ext/ext-all-debug.js view on Meta::CPAN
defaultType: 'button',
enableOverflow : false,
trackMenus : true,
internalDefaults: {removeMode: 'container', hideParent: true},
toolbarCls: 'x-toolbar',
initComponent : function(){
T.superclass.initComponent.call(this);
this.addEvents('overflowchange');
},
share/ext/ext-all-debug.js view on Meta::CPAN
var buttons = [];
for(var i = 0, len = item.length; i < len; i++) {
buttons.push(this.insertButton(index + i, item[i]));
}
return buttons;
}
return Ext.Toolbar.superclass.insert.call(this, index, item);
},
trackMenu : function(item, remove){
if(this.trackMenus && item.menu){
var method = remove ? 'mun' : 'mon';
this[method](item, 'menutriggerover', this.onButtonTriggerOver, this);
this[method](item, 'menushow', this.onButtonMenuShow, this);
this[method](item, 'menuhide', this.onButtonMenuHide, this);
}
},
constructButton : function(item){
var b = item.events ? item : this.createComponent(item, item.split ? 'splitbutton' : this.defaultType);
return b;
},
onAdd : function(c){
Ext.Toolbar.superclass.onAdd.call(this);
this.trackMenu(c);
if(this.disabled){
c.disable();
}
},
onRemove : function(c){
Ext.Toolbar.superclass.onRemove.call(this);
if (c == this.activeMenuBtn) {
delete this.activeMenuBtn;
}
this.trackMenu(c, true);
},
onDisable : function(){
this.items.each(function(item){
if(item.disable){
item.disable();
}
});
},
share/ext/ext-all-debug.js view on Meta::CPAN
onEnable : function(){
this.items.each(function(item){
if(item.enable){
item.enable();
}
});
},
onButtonTriggerOver : function(btn){
if(this.activeMenuBtn && this.activeMenuBtn != btn){
this.activeMenuBtn.hideMenu();
btn.showMenu();
this.activeMenuBtn = btn;
}
},
onButtonMenuShow : function(btn){
this.activeMenuBtn = btn;
},
onButtonMenuHide : function(btn){
delete this.activeMenuBtn;
}
});
Ext.reg('toolbar', Ext.Toolbar);
T.Item = Ext.extend(Ext.BoxComponent, {
hideParent: true,
enable:Ext.emptyFn,
disable:Ext.emptyFn,
focus:Ext.emptyFn
share/ext/ext-all-debug.js view on Meta::CPAN
t.mon(t.innerCt, {
scope: this,
mouseover: this.delegateOver,
mouseout: this.delegateOut
});
}
t.mon(t.getTreeEl(), {
scope: this,
click: this.delegateClick,
dblclick: this.delegateDblClick,
contextmenu: this.delegateContextMenu
});
},
getNode : function(e){
var t;
if(t = e.getTarget('.x-tree-node-el', 10)){
var id = Ext.fly(t, '_treeEvents').getAttribute('tree-node-id', 'ext');
if(id){
return this.tree.getNodeById(id);
}
share/ext/ext-all-debug.js view on Meta::CPAN
delegateDblClick : function(e, t){
if(this.beforeEvent(e)){
if(this.getNodeTarget(e)){
this.onNodeDblClick(e, this.getNode(e));
}
}else{
this.checkContainerEvent(e, 'dblclick');
}
},
delegateContextMenu : function(e, t){
if(this.beforeEvent(e)){
if(this.getNodeTarget(e)){
this.onNodeContextMenu(e, this.getNode(e));
}
}else{
this.checkContainerEvent(e, 'contextmenu');
}
},
checkContainerEvent: function(e, type){
if(this.disabled){
e.stopEvent();
return false;
share/ext/ext-all-debug.js view on Meta::CPAN
},
onCheckboxClick : function(e, node){
node.ui.onCheckChange(e);
},
onNodeDblClick : function(e, node){
node.ui.onDblClick(e);
},
onNodeContextMenu : function(e, node){
node.ui.onContextMenu(e);
},
beforeEvent : function(e){
var node = this.getNode(e);
if(this.disabled || !node || !node.ui){
e.stopEvent();
return false;
}
return true;
},
share/ext/ext-all-debug.js view on Meta::CPAN
show : function(){
this.node.hidden = false;
if(this.wrap){
this.wrap.style.display = "";
}
},
onContextMenu : function(e){
if (this.node.hasListener("contextmenu") || this.node.getOwnerTree().hasListener("contextmenu")) {
e.preventDefault();
this.focus();
this.fireEvent("contextmenu", this.node, e);
}
},
onClick : function(e){
if(this.dropping){
share/ext/ext-all-debug.js view on Meta::CPAN
type: "bar"
});
Ext.chart.PieSeries = Ext.extend(Ext.chart.Series, {
type: "pie",
dataField: null,
categoryField: null
});
Ext.menu.Menu = Ext.extend(Ext.Container, {
minWidth : 120,
shadow : 'sides',
subMenuAlign : 'tl-tr?',
defaultAlign : 'tl-bl?',
allowOtherMenus : false,
ignoreParentClicks : false,
enableScrolling : true,
maxHeight : null,
scrollIncrement : 24,
showSeparator : true,
share/ext/ext-all-debug.js view on Meta::CPAN
this.addEvents(
'click',
'mouseover',
'mouseout',
'itemclick'
);
Ext.menu.MenuMgr.register(this);
if(this.floating){
Ext.EventManager.onWindowResize(this.hide, this);
}else{
if(this.initialConfig.hidden !== false){
this.hidden = false;
}
this.internalDefaults = {hideOnClick: false};
}
Ext.menu.Menu.superclass.initComponent.call(this);
if(this.autoLayout){
var fn = this.doLayout.createDelegate(this, []);
this.on({
add: fn,
remove: fn
});
}
},
share/ext/ext-all-debug.js view on Meta::CPAN
this.el = new Ext.Layer({
shadow: this.shadow,
dh: dh,
constrain: false,
parentEl: ct,
zindex: this.zIndex
});
}else{
this.el = ct.createChild(dh);
}
Ext.menu.Menu.superclass.onRender.call(this, ct, position);
if(!this.keyNav){
this.keyNav = new Ext.menu.MenuNav(this);
}
this.focusEl = this.el.child('a.x-menu-focus');
this.ul = this.el.child('ul.x-menu-list');
this.mon(this.ul, {
scope: this,
click: this.onClick,
mouseover: this.onMouseOver,
mouseout: this.onMouseOut
});
share/ext/ext-all-debug.js view on Meta::CPAN
},
onClick : function(e){
var t = this.findTargetItem(e);
if(t){
if(t.isFormField){
this.setActiveItem(t);
}else if(t instanceof Ext.menu.BaseItem){
if(t.menu && this.ignoreParentClicks){
t.expandMenu();
e.preventDefault();
}else if(t.onClick){
t.onClick(e);
this.fireEvent('click', this, t, e);
}
}
}
},
setActiveItem : function(item, autoExpand){
if(item != this.activeItem){
this.deactivateActive();
if((this.activeItem = item).isFormField){
item.focus();
}else{
item.activate(autoExpand);
}
}else if(autoExpand){
item.expandMenu();
}
},
deactivateActive : function(){
var a = this.activeItem;
if(a){
if(a.isFormField){
if(a.collapse){
a.collapse();
share/ext/ext-all-debug.js view on Meta::CPAN
Ext.fly(t).addClass(['x-menu-item-active', 'x-menu-scroller-active']);
}
},
onScrollerOut : function(e, t){
Ext.fly(t).removeClass(['x-menu-item-active', 'x-menu-scroller-active']);
},
show : function(el, pos, parentMenu){
if(this.floating){
this.parentMenu = parentMenu;
if(!this.el){
this.render();
this.doLayout(false, true);
}
this.showAt(this.el.getAlignToXY(el, pos || this.defaultAlign, this.defaultOffsets), parentMenu);
}else{
Ext.menu.Menu.superclass.show.call(this);
}
},
showAt : function(xy, parentMenu){
if(this.fireEvent('beforeshow', this) !== false){
this.parentMenu = parentMenu;
if(!this.el){
this.render();
}
if(this.enableScrolling){
this.el.setXY(xy);
xy[1] = this.constrainScroll(xy[1]);
xy = [this.el.adjustForConstraints(xy)[0], xy[1]];
}else{
xy = this.el.adjustForConstraints(xy);
}
this.el.setXY(xy);
this.el.show();
Ext.menu.Menu.superclass.onShow.call(this);
if(Ext.isIE){
this.fireEvent('autosize', this);
if(!Ext.isIE8){
this.el.repaint();
}
}
this.hidden = false;
this.focus();
this.fireEvent('show', this);
share/ext/ext-all-debug.js view on Meta::CPAN
doFocus : function(){
if(!this.hidden){
this.focusEl.focus();
}
},
hide : function(deep){
if (!this.isDestroyed) {
this.deepHide = deep;
Ext.menu.Menu.superclass.hide.call(this);
delete this.deepHide;
}
},
onHide : function(){
Ext.menu.Menu.superclass.onHide.call(this);
this.deactivateActive();
if(this.el && this.floating){
this.el.hide();
}
var pm = this.parentMenu;
if(this.deepHide === true && pm){
if(pm.floating){
pm.hide(true);
}else{
pm.deactivateActive();
}
}
},
lookupComponent : function(c){
if(Ext.isString(c)){
c = (c == 'separator' || c == '-') ? new Ext.menu.Separator() : new Ext.menu.TextItem(c);
this.applyDefaults(c);
}else{
if(Ext.isObject(c)){
c = this.getMenuItem(c);
}else if(c.tagName || c.el){
c = new Ext.BoxComponent({
el: c
});
}
}
return c;
},
applyDefaults : function(c) {
if (!Ext.isString(c)) {
c = Ext.menu.Menu.superclass.applyDefaults.call(this, c);
var d = this.internalDefaults;
if(d){
if(c.events){
Ext.applyIf(c.initialConfig, d);
Ext.apply(c, d);
}else{
Ext.applyIf(c, d);
}
}
}
return c;
},
getMenuItem : function(config) {
if (!config.isXType) {
if (!config.xtype && Ext.isBoolean(config.checked)) {
return new Ext.menu.CheckItem(config);
}
return Ext.create(config, this.defaultType);
}
return config;
},
share/ext/ext-all-debug.js view on Meta::CPAN
el: el
}));
},
addItem : function(item) {
return this.add(item);
},
addMenuItem : function(config) {
return this.add(this.getMenuItem(config));
},
addText : function(text){
return this.add(new Ext.menu.TextItem(text));
},
onDestroy : function(){
Ext.EventManager.removeResizeListener(this.hide, this);
var pm = this.parentMenu;
if(pm && pm.activeChild == this){
delete pm.activeChild;
}
delete this.parentMenu;
Ext.menu.Menu.superclass.onDestroy.call(this);
Ext.menu.MenuMgr.unregister(this);
if(this.keyNav) {
this.keyNav.disable();
}
var s = this.scroller;
if(s){
Ext.destroy(s.topRepeater, s.bottomRepeater, s.top, s.bottom);
}
Ext.destroy(
this.el,
this.focusEl,
this.ul
);
}
});
Ext.reg('menu', Ext.menu.Menu);
Ext.menu.MenuNav = Ext.extend(Ext.KeyNav, function(){
function up(e, m){
if(!m.tryActivate(m.items.indexOf(m.activeItem)-1, -1)){
m.tryActivate(m.items.length-1, -1);
}
}
function down(e, m){
if(!m.tryActivate(m.items.indexOf(m.activeItem)+1, 1)){
m.tryActivate(0, 1);
}
}
return {
constructor : function(menu){
Ext.menu.MenuNav.superclass.constructor.call(this, menu.el);
this.scope = this.menu = menu;
},
doRelay : function(e, h){
var k = e.getKey();
if (this.menu.activeItem && this.menu.activeItem.isFormField && k != e.TAB) {
return false;
}
if(!this.menu.activeItem && e.isNavKeyPress() && k != e.SPACE && k != e.RETURN){
share/ext/ext-all-debug.js view on Meta::CPAN
down(e, m);
}
},
up : up,
down : down,
right : function(e, m){
if(m.activeItem){
m.activeItem.expandMenu(true);
}
},
left : function(e, m){
m.hide();
if(m.parentMenu && m.parentMenu.activeItem){
m.parentMenu.activeItem.activate();
}
},
enter : function(e, m){
if(m.activeItem){
e.stopPropagation();
m.activeItem.onClick(e);
m.fireEvent('click', this, m.activeItem);
return true;
}
}
};
}());
Ext.menu.MenuMgr = function(){
var menus, active, groups = {}, attached = false, lastShow = new Date();
function init(){
menus = {};
active = new Ext.util.MixedCollection();
Ext.getDoc().addKeyListener(27, function(){
if(active.length > 0){
hideAll();
}
share/ext/ext-all-debug.js view on Meta::CPAN
function onShow(m){
var last = active.last();
lastShow = new Date();
active.add(m);
if(!attached){
Ext.getDoc().on("mousedown", onMouseDown);
attached = true;
}
if(m.parentMenu){
m.getEl().setZIndex(parseInt(m.parentMenu.getEl().getStyle("z-index"), 10) + 3);
m.parentMenu.activeChild = m;
}else if(last && !last.isDestroyed && last.isVisible()){
m.getEl().setZIndex(parseInt(last.getEl().getStyle("z-index"), 10) + 3);
}
}
function onBeforeHide(m){
if(m.activeChild){
m.activeChild.hide();
}
if(m.autoHideTimer){
clearTimeout(m.autoHideTimer);
delete m.autoHideTimer;
}
}
function onBeforeShow(m){
var pm = m.parentMenu;
if(!pm && !m.allowOtherMenus){
hideAll();
}else if(pm && pm.activeChild){
pm.activeChild.hide();
}
}
function onMouseDown(e){
if(lastShow.getElapsed() > 50 && active.length > 0 && !e.getTarget(".x-menu")){
hideAll();
share/ext/ext-all-debug.js view on Meta::CPAN
get : function(menu){
if(typeof menu == "string"){
if(!menus){
return null;
}
return menus[menu];
}else if(menu.events){
return menu;
}else if(typeof menu.length == 'number'){
return new Ext.menu.Menu({items:menu});
}else{
return Ext.create(menu, 'menu');
}
},
unregister : function(menu){
delete menus[menu.id];
menu.un("beforehide", onBeforeHide);
menu.un("hide", onHide);
share/ext/ext-all-debug.js view on Meta::CPAN
'deactivate'
);
if(this.handler){
this.on("click", this.handler, this.scope);
}
},
onRender : function(container, position){
Ext.menu.BaseItem.superclass.onRender.apply(this, arguments);
if(this.ownerCt && this.ownerCt instanceof Ext.menu.Menu){
this.parentMenu = this.ownerCt;
}else{
this.container.addClass('x-menu-list-item');
this.mon(this.el, {
scope: this,
click: this.onClick,
mouseenter: this.activate,
mouseleave: this.deactivate
});
}
},
share/ext/ext-all-debug.js view on Meta::CPAN
setHandler : function(handler, scope){
if(this.handler){
this.un("click", this.handler, this.scope);
}
this.on("click", this.handler = handler, this.scope = scope);
},
onClick : function(e){
if(!this.disabled && this.fireEvent("click", this, e) !== false
&& (this.parentMenu && this.parentMenu.fireEvent("itemclick", this, e) !== false)){
this.handleClick(e);
}else{
e.stopEvent();
}
},
activate : function(){
if(this.disabled){
return false;
share/ext/ext-all-debug.js view on Meta::CPAN
this.fireEvent("deactivate", this);
},
shouldDeactivate : function(e){
return !this.region || !this.region.contains(e.getPoint());
},
handleClick : function(e){
var pm = this.parentMenu;
if(this.hideOnClick){
if(pm.floating){
pm.hide.defer(this.clickHideDelay, pm, [true]);
}else{
pm.deactivateActive();
}
}
},
expandMenu : Ext.emptyFn,
hideMenu : Ext.emptyFn
});
Ext.reg('menubaseitem', Ext.menu.BaseItem);
Ext.menu.TextItem = Ext.extend(Ext.menu.BaseItem, {
hideOnClick : false,
itemCls : "x-menu-text",
constructor : function(config) {
share/ext/ext-all-debug.js view on Meta::CPAN
hideDelay: 200,
ctype: 'Ext.menu.Item',
initComponent : function(){
Ext.menu.Item.superclass.initComponent.call(this);
if(this.menu){
this.menu = Ext.menu.MenuMgr.get(this.menu);
this.menu.ownerCt = this;
}
},
onRender : function(container, position){
if (!this.itemTpl) {
this.itemTpl = Ext.menu.Item.prototype.itemTpl = new Ext.XTemplate(
'<a id="{id}" class="{cls}" hidefocus="true" unselectable="on" href="{href}"',
'<tpl if="hrefTarget">',
share/ext/ext-all-debug.js view on Meta::CPAN
text: this.itemText||this.text||' ',
altText: this.altText || ''
};
},
setText : function(text){
this.text = text||' ';
if(this.rendered){
this.textEl.update(this.text);
this.parentMenu.layout.doAutoSize();
}
},
setIconClass : function(cls){
var oldCls = this.iconCls;
this.iconCls = cls;
if(this.rendered){
this.iconEl.replaceClass(oldCls, this.iconCls);
}
share/ext/ext-all-debug.js view on Meta::CPAN
e.stopEvent();
}
Ext.menu.Item.superclass.handleClick.apply(this, arguments);
},
activate : function(autoExpand){
if(Ext.menu.Item.superclass.activate.apply(this, arguments)){
this.focus();
if(autoExpand){
this.expandMenu();
}
}
return true;
},
shouldDeactivate : function(e){
if(Ext.menu.Item.superclass.shouldDeactivate.call(this, e)){
if(this.menu && this.menu.isVisible()){
return !this.menu.getEl().getRegion().contains(e.getPoint());
}
return true;
}
return false;
},
deactivate : function(){
Ext.menu.Item.superclass.deactivate.apply(this, arguments);
this.hideMenu();
},
expandMenu : function(autoActivate){
if(!this.disabled && this.menu){
clearTimeout(this.hideTimer);
delete this.hideTimer;
if(!this.menu.isVisible() && !this.showTimer){
this.showTimer = this.deferExpand.defer(this.showDelay, this, [autoActivate]);
}else if (this.menu.isVisible() && autoActivate){
this.menu.tryActivate(0, 1);
}
}
},
deferExpand : function(autoActivate){
delete this.showTimer;
this.menu.show(this.container, this.parentMenu.subMenuAlign || 'tl-tr?', this.parentMenu);
if(autoActivate){
this.menu.tryActivate(0, 1);
}
},
hideMenu : function(){
clearTimeout(this.showTimer);
delete this.showTimer;
if(!this.hideTimer && this.menu && this.menu.isVisible()){
this.hideTimer = this.deferHide.defer(this.hideDelay, this);
}
},
deferHide : function(){
delete this.hideTimer;
if(this.menu.over){
this.parentMenu.setActiveItem(this, false);
}else{
this.menu.hide();
}
}
});
Ext.reg('menuitem', Ext.menu.Item);
Ext.menu.CheckItem = Ext.extend(Ext.menu.Item, {
itemCls : "x-menu-item x-menu-check-item",
share/ext/ext-all-debug.js view on Meta::CPAN
this.addEvents(
"beforecheckchange" ,
"checkchange"
);
if(this.checkHandler){
this.on('checkchange', this.checkHandler, this.scope);
}
Ext.menu.MenuMgr.registerCheckable(this);
},
onRender : function(c){
Ext.menu.CheckItem.superclass.onRender.apply(this, arguments);
if(this.group){
this.el.addClass(this.groupClass);
}
if(this.checked){
this.checked = false;
this.setChecked(true, true);
}
},
destroy : function(){
Ext.menu.MenuMgr.unregisterCheckable(this);
Ext.menu.CheckItem.superclass.destroy.apply(this, arguments);
},
setChecked : function(state, suppressEvent){
var suppress = suppressEvent === true;
if(this.checked != state && (suppress || this.fireEvent("beforecheckchange", this, state) !== false)){
Ext.menu.MenuMgr.onCheckChange(this, state);
if(this.container){
this.container[state ? "addClass" : "removeClass"]("x-menu-item-checked");
}
this.checked = state;
if(!suppress){
this.fireEvent("checkchange", this, state);
}
}
},
handleClick : function(e){
if(!this.disabled && !(this.checked && this.group)){
this.setChecked(!this.checked);
}
Ext.menu.CheckItem.superclass.handleClick.apply(this, arguments);
}
});
Ext.reg('menucheckitem', Ext.menu.CheckItem);
Ext.menu.DateMenu = Ext.extend(Ext.menu.Menu, {
enableScrolling : false,
hideOnClick : true,
pickerId : null,
share/ext/ext-all-debug.js view on Meta::CPAN
Ext.apply(this, {
plain: true,
showSeparator: false,
items: this.picker = new Ext.DatePicker(Ext.applyIf({
internalRender: this.strict || !Ext.isIE,
ctCls: 'x-menu-date-item',
id: this.pickerId
}, this.initialConfig))
});
this.picker.purgeListeners();
Ext.menu.DateMenu.superclass.initComponent.call(this);
this.relayEvents(this.picker, ['select']);
this.on('show', this.picker.focus, this.picker);
this.on('select', this.menuHide, this);
if(this.handler){
this.on('select', this.handler, this.scope || this);
}
},
menuHide : function() {
share/ext/ext-all-debug.js view on Meta::CPAN
if(this.picker){
this.picker.hideMonthPicker(true);
}
},
onShow : function(){
var el = this.picker.getEl();
el.setWidth(el.getWidth());
}
});
Ext.reg('datemenu', Ext.menu.DateMenu);
Ext.menu.ColorMenu = Ext.extend(Ext.menu.Menu, {
enableScrolling : false,
hideOnClick : true,
cls : 'x-color-menu',
share/ext/ext-all-debug.js view on Meta::CPAN
initComponent : function(){
Ext.apply(this, {
plain: true,
showSeparator: false,
items: this.palette = new Ext.ColorPalette(Ext.applyIf({
id: this.paletteId
}, this.initialConfig))
});
this.palette.purgeListeners();
Ext.menu.ColorMenu.superclass.initComponent.call(this);
this.relayEvents(this.palette, ['select']);
this.on('select', this.menuHide, this);
if(this.handler){
this.on('select', this.handler, this.scope || this);
}
},
menuHide : function(){
if(this.hideOnClick){
this.hide(true);
}
}
});
Ext.reg('colormenu', Ext.menu.ColorMenu);
Ext.form.Field = Ext.extend(Ext.BoxComponent, {
share/ext/ext-all-debug.js view on Meta::CPAN
},
onTriggerClick : function(){
if(this.disabled){
return;
}
if(this.menu == null){
this.menu = new Ext.menu.DateMenu({
hideOnClick: false,
focusOnSelect: false
});
}
this.onFocus();
Ext.apply(this.menu.picker, {
minDate : this.minValue,
maxDate : this.maxValue,
disabledDatesRE : this.disabledDatesRE,
disabledDatesText : this.disabledDatesText,
share/ext/ext-all-debug.js view on Meta::CPAN
maxText : String.format(this.maxText, this.formatDate(this.maxValue))
});
this.menu.picker.setValue(this.getValue() || new Date());
this.menu.show(this.el, "tl-bl?");
this.menuEvents('on');
},
menuEvents: function(method){
this.menu[method]('select', this.onSelect, this);
this.menu[method]('hide', this.onMenuHide, this);
this.menu[method]('show', this.onFocus, this);
},
onSelect: function(m, d){
this.setValue(d);
this.fireEvent('select', this, d);
this.menu.hide();
},
onMenuHide: function(){
this.focus(false, 60);
this.menuEvents('un');
},
beforeBlur : function(){
var v = this.parseDate(this.getRawValue());
if(v){
this.setValue(v);
}
share/ext/ext-all-debug.js view on Meta::CPAN
if(this.enableColors){
items.push(
'-', {
itemId:'forecolor',
cls:'x-btn-icon',
iconCls: 'x-edit-forecolor',
clickEvent:'mousedown',
tooltip: tipsEnabled ? editor.buttonTips.forecolor || undefined : undefined,
tabIndex:-1,
menu : new Ext.menu.ColorMenu({
allowReselect: true,
focus: Ext.emptyFn,
value:'000000',
plain:true,
listeners: {
scope: this,
select: function(cp, color){
this.execCmd('forecolor', Ext.isWebKit || Ext.isIE ? '#'+color : color);
this.deferFocus();
}
},
clickEvent:'mousedown'
})
}, {
itemId:'backcolor',
cls:'x-btn-icon',
iconCls: 'x-edit-backcolor',
clickEvent:'mousedown',
tooltip: tipsEnabled ? editor.buttonTips.backcolor || undefined : undefined,
tabIndex:-1,
menu : new Ext.menu.ColorMenu({
focus: Ext.emptyFn,
value:'FFFFFF',
plain:true,
allowReselect: true,
listeners: {
scope: this,
select: function(cp, color){
if(Ext.isGecko){
this.execCmd('useCSS', false);
this.execCmd('hilitecolor', color);
share/ext/ext-all-debug.js view on Meta::CPAN
if(this.enableAlignments){
btns.justifyleft.toggle(doc.queryCommandState('justifyleft'));
btns.justifycenter.toggle(doc.queryCommandState('justifycenter'));
btns.justifyright.toggle(doc.queryCommandState('justifyright'));
}
if(!Ext.isSafari2 && this.enableLists){
btns.insertorderedlist.toggle(doc.queryCommandState('insertorderedlist'));
btns.insertunorderedlist.toggle(doc.queryCommandState('insertunorderedlist'));
}
Ext.menu.MenuMgr.hideAll();
this.syncValue();
},
relayBtnCmd : function(btn){
this.relayCmd(btn.getItemId());
},
share/ext/ext-all-debug.js view on Meta::CPAN
enableColumnHide : true,
enableColumnMove : true,
enableDragDrop : false,
enableHdMenu : true,
loadMask : false,
minColumnWidth : 25,
share/ext/ext-all-debug.js view on Meta::CPAN
var c = this.getGridEl();
this.el.addClass('x-grid-panel');
this.mon(c, {
scope: this,
mousedown: this.onMouseDown,
click: this.onClick,
dblclick: this.onDblClick,
contextmenu: this.onContextMenu
});
this.relayEvents(c, ['mousedown','mouseup','mouseover','mouseout','keypress', 'keydown']);
var view = this.getView();
view.init(this);
view.render();
this.getSelectionModel().init(this);
},
share/ext/ext-all-debug.js view on Meta::CPAN
onClick : function(e){
this.processEvent('click', e);
},
onMouseDown : function(e){
this.processEvent('mousedown', e);
},
onContextMenu : function(e, t){
this.processEvent('contextmenu', e);
},
onDblClick : function(e){
this.processEvent('dblclick', e);
},
walkCells : function(row, col, step, fn, scope){
share/ext/ext-all-debug.js view on Meta::CPAN
rowBodySelector : 'div.x-grid3-row-body',
firstRowCls: 'x-grid3-row-first',
lastRowCls: 'x-grid3-row-last',
rowClsRe: /(?:^|\s+)x-grid3-row-(first|last|alt)(?:\s+|$)/g,
headerMenuOpenCls: 'x-grid3-hd-menu-open',
rowOverCls: 'x-grid3-row-over',
constructor : function(config) {
Ext.apply(this, config);
this.addEvents(
share/ext/ext-all-debug.js view on Meta::CPAN
),
initTemplates : function() {
var templates = this.templates || {},
template, name,
headerCellTpl = new Ext.Template(
'<td class="x-grid3-hd x-grid3-cell x-grid3-td-{id} {css}" style="{style}">',
'<div {tooltip} {attr} 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}',
'<img alt="" class="x-grid3-sort-icon" src="', Ext.BLANK_IMAGE_URL, '" />',
'</div>',
'</td>'
),
rowBodyText = [
'<tr class="x-grid3-row-body-tr" style="{bodyStyle}">',
'<td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on">',
'<div class="x-grid3-row-body">{body}</div>',
share/ext/ext-all-debug.js view on Meta::CPAN
if (grid.enableColumnResize !== false) {
this.splitZone = new Ext.grid.GridView.SplitDragZone(grid, this.mainHd.dom);
}
if (grid.enableColumnMove) {
this.columnDrag = new Ext.grid.GridView.ColumnDragZone(grid, this.innerHd);
this.columnDrop = new Ext.grid.HeaderDropZone(grid, this.mainHd.dom);
}
if (grid.enableHdMenu !== false) {
this.hmenu = new Ext.menu.Menu({id: grid.id + '-hctx'});
this.hmenu.add(
{itemId:'asc', text: this.sortAscText, cls: 'xg-hmenu-sort-asc'},
{itemId:'desc', text: this.sortDescText, cls: 'xg-hmenu-sort-desc'}
);
if (grid.enableColumnHide !== false) {
this.colMenu = new Ext.menu.Menu({id:grid.id + '-hcols-menu'});
this.colMenu.on({
scope : this,
beforeshow: this.beforeColMenuShow,
itemclick : this.handleHdMenuClick
});
this.hmenu.add('-', {
itemId:'columns',
hideOnClick: false,
text: this.columnsText,
menu: this.colMenu,
iconCls: 'x-cols-icon'
});
}
this.hmenu.on('itemclick', this.handleHdMenuClick, this);
}
if (grid.trackMouseOver) {
this.mainBody.on({
scope : this,
mouseover: this.onRowOver,
mouseout : this.onRowOut
});
}
share/ext/ext-all-debug.js view on Meta::CPAN
columnDrag = me.columnDrag,
columnDrop = me.columnDrop,
scrollToTopTask = me.scrollToTopTask,
columnDragData,
columnDragProxy;
if (scrollToTopTask && scrollToTopTask.cancel) {
scrollToTopTask.cancel();
}
Ext.destroyMembers(me, 'colMenu', 'hmenu');
me.initData(null, null);
me.purgeListeners();
Ext.fly(me.innerHd).un("click", me.handleHdDown, me);
if (grid.enableColumnMove) {
columnDragData = columnDrag.dragData;
columnDragProxy = columnDrag.proxy;
Ext.destroy(
share/ext/ext-all-debug.js view on Meta::CPAN
this.updateAllColumnWidths();
} else {
this.updateColumnWidth(cellIndex, width);
this.syncHeaderScroll();
}
this.grid.fireEvent('columnresize', cellIndex, width);
},
beforeColMenuShow : function() {
var colModel = this.cm,
colCount = colModel.getColumnCount(),
colMenu = this.colMenu,
i;
colMenu.removeAll();
for (i = 0; i < colCount; i++) {
if (colModel.config[i].hideable !== false) {
colMenu.add(new Ext.menu.CheckItem({
text : colModel.getColumnHeader(i),
itemId : 'col-' + colModel.getColumnId(i),
checked : !colModel.isHidden(i),
disabled : colModel.config[i].hideable === false,
hideOnClick: false
}));
}
}
},
handleHdMenuClick : function(item) {
var store = this.ds,
dataIndex = this.cm.getDataIndex(this.hdCtxIndex);
switch (item.getItemId()) {
case 'asc':
store.sort(dataIndex, 'ASC');
break;
case 'desc':
store.sort(dataIndex, 'DESC');
break;
default:
this.handleHdMenuClickDefault(item);
}
return true;
},
handleHdMenuClickDefault: function(item) {
var colModel = this.cm,
itemId = item.getItemId(),
index = colModel.getIndexById(itemId.substr(4));
if (index != -1) {
if (item.checked && colModel.getColumnsBy(this.isHideableColumn, this).length <= 1) {
this.onDenyColumnHide();
return;
}
colModel.setHidden(index, item.checked);
share/ext/ext-all-debug.js view on Meta::CPAN
handleHdDown : function(e, target) {
if (Ext.fly(target).hasClass('x-grid3-hd-btn')) {
e.stopEvent();
var colModel = this.cm,
header = this.findHeaderCell(target),
index = this.getCellIndex(header),
sortable = colModel.isSortable(index),
menu = this.hmenu,
menuItems = menu.items,
menuCls = this.headerMenuOpenCls;
this.hdCtxIndex = index;
Ext.fly(header).addClass(menuCls);
menuItems.get('asc').setDisabled(!sortable);
menuItems.get('desc').setDisabled(!sortable);
menu.on('hide', function() {
Ext.fly(header).removeClass(menuCls);
}, this, {single:true});
share/ext/ext-all-debug.js view on Meta::CPAN
handleHdOver : function(e, target) {
var header = this.findHeaderCell(target);
if (header && !this.headersDisabled) {
var fly = this.fly(header);
this.activeHdRef = target;
this.activeHdIndex = this.getCellIndex(header);
this.activeHdRegion = fly.getRegion();
if (!this.isMenuDisabled(this.activeHdIndex, fly)) {
fly.addClass('x-grid3-hd-over');
this.activeHdBtn = fly.child('.x-grid3-hd-btn');
if (this.activeHdBtn) {
this.activeHdBtn.dom.style.height = (header.firstChild.offsetHeight - 1) + 'px';
}
}
}
},
share/ext/ext-all-debug.js view on Meta::CPAN
var header = this.findHeaderCell(target);
if (header && (!Ext.isIE || !e.within(header, true))) {
this.activeHdRef = null;
this.fly(header).removeClass('x-grid3-hd-over');
header.style.cursor = '';
}
},
isMenuDisabled: function(cellIndex, el) {
return this.cm.isMenuDisabled(cellIndex);
},
hasRows : function() {
var fc = this.mainBody.dom.firstChild;
return fc && fc.nodeType == 1 && fc.className != 'x-grid-empty';
},
isHideableColumn : function(c) {
share/ext/ext-all-debug.js view on Meta::CPAN
initTemplates: function() {
Ext.grid.PivotGridView.superclass.initTemplates.apply(this, arguments);
var templates = this.templates || {};
if (!templates.gcell) {
templates.gcell = new Ext.XTemplate(
'<td class="x-grid3-hd x-grid3-gcell x-grid3-td-{id} ux-grid-hd-group-row-{row} ' + this.colHeaderCellCls + '" 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 = templates;
this.hrowRe = new RegExp("ux-grid-hd-group-row-(\\d+)", "");
},
share/ext/ext-all-debug.js view on Meta::CPAN
renderGroupColumnHeaders: function() {
var topAxis = this.grid.topAxis;
topAxis.rendered = false;
topAxis.render(this.innerHd.firstChild);
},
isMenuDisabled: function(cellIndex, el) {
return true;
}
});
Ext.grid.PivotAxis = Ext.extend(Ext.Component, {
orientation: 'horizontal',
defaultHeaderWidth: 80,
share/ext/ext-all-debug.js view on Meta::CPAN
return result;
},
isSortable : function(col) {
return !!this.config[col].sortable;
},
isMenuDisabled : function(col) {
return !!this.config[col].menuDisabled;
},
getRenderer : function(col) {
return this.config[col].renderer || Ext.grid.ColumnModel.defaultRenderer;
},
getRendererScope : function(col) {
return this.config[col].scope;
share/ext/ext-all-debug.js view on Meta::CPAN
enableColumnMove:false,
stripeRows:false,
trackMouseOver: false,
clicksToEdit:1,
enableHdMenu : false,
viewConfig : {
forceFit:true
},
initComponent : function(){
this.customRenderers = this.customRenderers || {};
this.customEditors = this.customEditors || {};
this.lastEditRow = null;
var store = new Ext.grid.PropertyStore(this);
share/ext/ext-all-debug.js view on Meta::CPAN
showGroupsText : 'Show in Groups',
hideGroupedColumn : false,
showGroupName : true,
startCollapsed : false,
enableGrouping : true,
enableGroupingMenu : true,
enableNoGroups : true,
emptyGroupText : '(None)',
ignoreAdd : false,
groupTextTpl : '{text}',
share/ext/ext-all-debug.js view on Meta::CPAN
if(this.ds.getCount()==1){
this.refresh();
}else{
this.isUpdating = true;
Ext.grid.GroupingView.superclass.refreshRow.apply(this, arguments);
this.isUpdating = false;
}
},
beforeMenuShow : function(){
var item, items = this.hmenu.items, disabled = this.cm.config[this.hdCtxIndex].groupable === false;
if((item = items.get('groupBy'))){
item.setDisabled(disabled);
}
if((item = items.get('showGroups'))){
item.setDisabled(disabled);
item.setChecked(this.canGroup(), true);
}
},
renderUI : function(){
var markup = Ext.grid.GroupingView.superclass.renderUI.call(this);
if(this.enableGroupingMenu && this.hmenu){
this.hmenu.add('-',{
itemId:'groupBy',
text: this.groupByText,
handler: this.onGroupByClick,
scope: this,
iconCls:'x-group-by-icon'
});
if(this.enableNoGroups){
this.hmenu.add({
itemId:'showGroups',
text: this.showGroupsText,
checked: true,
checkHandler: this.onShowGroupsClick,
scope: this
});
}
this.hmenu.on('beforeshow', this.beforeMenuShow, this);
}
return markup;
},
processEvent: function(name, e){
Ext.grid.GroupingView.superclass.processEvent.call(this, name, e);
var hd = e.getTarget('.x-grid-group-hd', this.mainBody);
if(hd){
var field = this.getGroupField(),
share/ext/ext-all-debug.js view on Meta::CPAN
}
},
onGroupByClick : function(){
var grid = this.grid;
this.enableGrouping = true;
grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));
grid.fireEvent('groupchange', grid, grid.store.getGroupState());
this.beforeMenuShow();
this.refresh();
},
onShowGroupsClick : function(mi, checked){
this.enableGrouping = checked;
if(checked){
this.onGroupByClick();
}else{
this.grid.store.clearGrouping();
share/ext/ext-all-debug.js view on Meta::CPAN
}
Ext.grid.GroupingView.superclass.afterRender.call(this);
if(this.grid.deferRowRender){
this.updateGroupWidths();
}
},
afterRenderUI: function () {
Ext.grid.GroupingView.superclass.afterRenderUI.call(this);
if (this.enableGroupingMenu && this.hmenu) {
this.hmenu.add('-',{
itemId:'groupBy',
text: this.groupByText,
handler: this.onGroupByClick,
scope: this,
iconCls:'x-group-by-icon'
});
if (this.enableNoGroups) {
this.hmenu.add({
itemId:'showGroups',
text: this.showGroupsText,
checked: true,
checkHandler: this.onShowGroupsClick,
scope: this
});
}
this.hmenu.on('beforeshow', this.beforeMenuShow, this);
}
},
renderRows : function(){
var groupField = this.getGroupField();
var eg = !!groupField;
if(this.hideGroupedColumn) {
var colIndex = this.cm.findColumnIndex(groupField),
share/ext/ext-all.js view on Meta::CPAN
/*
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* licensing@sencha.com
* http://www.sencha.com/license
*/
(function(){var h=Ext.util,k=Ext.each,g=true,i=false;h.Observable=function(){var l=this,m=l.events;if(l.listeners){l.on(l.listeners);delete l.listeners}l.events=m||{}};h.Observable.prototype={filterOptRe:/^(?:scope|delay|buffer|single)$/,fireEvent:fu...
/* SWFObject v2.2 <http://code.google.com/p/swfobject/>
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject=function(){var F="undefined",t="object",U="Shockwave Flash",Y="ShockwaveFlash.ShockwaveFlash",s="application/x-shockwave-flash",T="SWFObjectExprInst",z="onreadystatechange",Q=window,l=document,v=navigator,V=false,W=[i],q=[],P=[],K=[],n,...