view release on metacpan or search on metacpan
share/ext/ext-all-debug.js view on Meta::CPAN
is : function(simpleSelector){
return Ext.DomQuery.is(this.dom, simpleSelector);
},
focus : function(defer, dom) {
var me = this,
dom = dom || me.dom;
try{
if(Number(defer)){
me.focus.defer(defer, null, [null, dom]);
}else{
dom.focus();
}
}catch(e){}
return me;
},
blur : function() {
try{
this.dom.blur();
}catch(e){}
return this;
},
getValue : function(asNumber){
var val = this.dom.value;
return asNumber ? parseInt(val, 10) : val;
},
addListener : function(eventName, fn, scope, options){
Ext.EventManager.on(this.dom, eventName, fn, scope || this, options);
return this;
},
removeListener : function(eventName, fn, scope){
Ext.EventManager.removeListener(this.dom, eventName, fn, scope || this);
return this;
},
removeAllListeners : function(){
Ext.EventManager.removeAll(this.dom);
return this;
},
purgeAllListeners : function() {
Ext.EventManager.purgeElement(this, true);
return this;
},
addUnits : function(size){
if(size === "" || size == "auto" || size === undefined){
size = size || '';
} else if(!isNaN(size) || !unitPattern.test(size)){
size = size + (this.defaultUnit || 'px');
}
return size;
},
load : function(url, params, cb){
Ext.Ajax.request(Ext.apply({
params: params,
url: url.url || url,
callback: cb,
el: this.dom,
indicatorText: url.indicatorText || ''
}, Ext.isObject(url) ? url : {}));
return this;
},
isBorderBox : function(){
return Ext.isBorderBox || Ext.isForcedBorderBox || noBoxAdjust[(this.dom.tagName || "").toLowerCase()];
},
remove : function(){
var me = this,
dom = me.dom;
if (dom) {
delete me.dom;
Ext.removeNode(dom);
}
},
hover : function(overFn, outFn, scope, options){
var me = this;
me.on('mouseenter', overFn, scope || me.dom, options);
me.on('mouseleave', outFn, scope || me.dom, options);
return me;
},
contains : function(el){
return !el ? false : Ext.lib.Dom.isAncestor(this.dom, el.dom ? el.dom : el);
},
getAttributeNS : function(ns, name){
return this.getAttribute(name, ns);
},
getAttribute : Ext.isIE ? function(name, ns){
var d = this.dom,
type = typeof d[ns + ":" + name];
if(['undefined', 'unknown'].indexOf(type) == -1){
return d[ns + ":" + name];
}
return d[name];
share/ext/ext-all-debug.js view on Meta::CPAN
var flyFn = function(){};
flyFn.prototype = El.prototype;
El.Flyweight = function(dom){
this.dom = dom;
};
El.Flyweight.prototype = new flyFn();
El.Flyweight.prototype.isFlyweight = true;
El._flyweights = {};
El.fly = function(el, named){
var ret = null;
named = named || '_global';
if (el = Ext.getDom(el)) {
(El._flyweights[named] = El._flyweights[named] || new El.Flyweight()).dom = el;
ret = El._flyweights[named];
}
return ret;
};
Ext.get = El.get;
Ext.fly = El.fly;
var noBoxAdjust = Ext.isStrict ? {
select:1
} : {
input:1, select:1, textarea:1
};
if(Ext.isIE || Ext.isGecko){
noBoxAdjust['button'] = 1;
}
})();
Ext.Element.addMethods(function(){
var PARENTNODE = 'parentNode',
NEXTSIBLING = 'nextSibling',
PREVIOUSSIBLING = 'previousSibling',
DQ = Ext.DomQuery,
GET = Ext.get;
return {
findParent : function(simpleSelector, maxDepth, returnEl){
var p = this.dom,
b = document.body,
depth = 0,
stopEl;
if(Ext.isGecko && Object.prototype.toString.call(p) == '[object XULElement]') {
return null;
}
maxDepth = maxDepth || 50;
if (isNaN(maxDepth)) {
stopEl = Ext.getDom(maxDepth);
maxDepth = Number.MAX_VALUE;
}
while(p && p.nodeType == 1 && depth < maxDepth && p != b && p != stopEl){
if(DQ.is(p, simpleSelector)){
return returnEl ? GET(p) : p;
}
depth++;
p = p.parentNode;
}
return null;
},
findParentNode : function(simpleSelector, maxDepth, returnEl){
var p = Ext.fly(this.dom.parentNode, '_internal');
return p ? p.findParent(simpleSelector, maxDepth, returnEl) : null;
},
up : function(simpleSelector, maxDepth){
return this.findParentNode(simpleSelector, maxDepth, true);
},
select : function(selector){
return Ext.Element.select(selector, this.dom);
},
query : function(selector){
return DQ.select(selector, this.dom);
},
child : function(selector, returnDom){
var n = DQ.selectNode(selector, this.dom);
return returnDom ? n : GET(n);
},
down : function(selector, returnDom){
var n = DQ.selectNode(" > " + selector, this.dom);
return returnDom ? n : GET(n);
},
parent : function(selector, returnDom){
return this.matchNode(PARENTNODE, PARENTNODE, selector, returnDom);
},
next : function(selector, returnDom){
return this.matchNode(NEXTSIBLING, NEXTSIBLING, selector, returnDom);
},
prev : function(selector, returnDom){
return this.matchNode(PREVIOUSSIBLING, PREVIOUSSIBLING, selector, returnDom);
},
share/ext/ext-all-debug.js view on Meta::CPAN
toggleClass : function(className){
return this.hasClass(className) ? this.removeClass(className) : this.addClass(className);
},
hasClass : function(className){
return className && (' '+this.dom.className+' ').indexOf(' '+className+' ') != -1;
},
replaceClass : function(oldClassName, newClassName){
return this.removeClass(oldClassName).addClass(newClassName);
},
isStyle : function(style, val) {
return this.getStyle(style) == val;
},
getStyle : function(){
return view && view.getComputedStyle ?
function(prop){
var el = this.dom,
v,
cs,
out,
display;
if(el == document){
return null;
}
prop = chkCache(prop);
out = (v = el.style[prop]) ? v :
(cs = view.getComputedStyle(el, "")) ? cs[prop] : null;
if(prop == 'marginRight' && out != '0px' && !supports.correctRightMargin){
display = el.style.display;
el.style.display = 'inline-block';
out = view.getComputedStyle(el, '').marginRight;
el.style.display = display;
}
if(prop == 'backgroundColor' && out == 'rgba(0, 0, 0, 0)' && !supports.correctTransparentColor){
out = 'transparent';
}
return out;
} :
function(prop){
var el = this.dom,
m,
cs;
if(el == document) return null;
if (prop == 'opacity') {
if (el.style.filter.match) {
if(m = el.style.filter.match(opacityRe)){
var fv = parseFloat(m[1]);
if(!isNaN(fv)){
return fv ? fv / 100 : 0;
}
}
}
return 1;
}
prop = chkCache(prop);
return el.style[prop] || ((cs = el.currentStyle) ? cs[prop] : null);
};
}(),
getColor : function(attr, defaultValue, prefix){
var v = this.getStyle(attr),
color = (typeof prefix != 'undefined') ? prefix : '#',
h;
if(!v || (/transparent|inherit/.test(v))) {
return defaultValue;
}
if(/^r/.test(v)){
Ext.each(v.slice(4, v.length -1).split(','), function(s){
h = parseInt(s, 10);
color += (h < 16 ? '0' : '') + h.toString(16);
});
}else{
v = v.replace('#', '');
color += v.length == 3 ? v.replace(/^(\w)(\w)(\w)$/, '$1$1$2$2$3$3') : v;
}
return(color.length > 5 ? color.toLowerCase() : defaultValue);
},
setStyle : function(prop, value){
var tmp, style;
if (typeof prop != 'object') {
tmp = {};
tmp[prop] = value;
prop = tmp;
}
for (style in prop) {
value = prop[style];
style == 'opacity' ?
this.setOpacity(value) :
this.dom.style[chkCache(style)] = value;
}
return this;
},
setOpacity : function(opacity, animate){
var me = this,
s = me.dom.style;
if(!animate || !me.anim){
if(Ext.isIE){
var opac = opacity < 1 ? 'alpha(opacity=' + opacity * 100 + ')' : '',
val = s.filter.replace(opacityRe, '').replace(trimRe, '');
share/ext/ext-all-debug.js view on Meta::CPAN
var me = this;
if(!pos && me.isStyle(POSITION, STATIC)){
me.setStyle(POSITION, RELATIVE);
} else if(pos) {
me.setStyle(POSITION, pos);
}
if(zIndex){
me.setStyle(ZINDEX, zIndex);
}
if(x || y) me.setXY([x || false, y || false]);
},
clearPositioning : function(value){
value = value || '';
this.setStyle({
left : value,
right : value,
top : value,
bottom : value,
"z-index" : "",
position : STATIC
});
return this;
},
getPositioning : function(){
var l = this.getStyle(LEFT);
var t = this.getStyle(TOP);
return {
"position" : this.getStyle(POSITION),
"left" : l,
"right" : l ? "" : this.getStyle(RIGHT),
"top" : t,
"bottom" : t ? "" : this.getStyle(BOTTOM),
"z-index" : this.getStyle(ZINDEX)
};
},
setPositioning : function(pc){
var me = this,
style = me.dom.style;
me.setStyle(pc);
if(pc.right == AUTO){
style.right = "";
}
if(pc.bottom == AUTO){
style.bottom = "";
}
return me;
},
translatePoints : function(x, y){
y = isNaN(x[1]) ? y : x[1];
x = isNaN(x[0]) ? x : x[0];
var me = this,
relative = me.isStyle(POSITION, RELATIVE),
o = me.getXY(),
l = parseInt(me.getStyle(LEFT), 10),
t = parseInt(me.getStyle(TOP), 10);
l = !isNaN(l) ? l : (relative ? 0 : me.dom.offsetLeft);
t = !isNaN(t) ? t : (relative ? 0 : me.dom.offsetTop);
return {left: (x - o[0] + l), top: (y - o[1] + t)};
},
animTest : function(args, animate, i) {
return !!animate && this.preanim ? this.preanim(args, i) : false;
}
});
})();
Ext.Element.addMethods({
isScrollable : function(){
var dom = this.dom;
return dom.scrollHeight > dom.clientHeight || dom.scrollWidth > dom.clientWidth;
},
scrollTo : function(side, value){
this.dom["scroll" + (/top/i.test(side) ? "Top" : "Left")] = value;
return this;
},
getScroll : function(){
var d = this.dom,
doc = document,
body = doc.body,
docElement = doc.documentElement,
l,
t,
ret;
if(d == doc || d == body){
if(Ext.isIE && Ext.isStrict){
l = docElement.scrollLeft;
t = docElement.scrollTop;
}else{
l = window.pageXOffset;
t = window.pageYOffset;
}
ret = {left: l || (body ? body.scrollLeft : 0), top: t || (body ? body.scrollTop : 0)};
}else{
ret = {left: d.scrollLeft, top: d.scrollTop};
}
return ret;
}
});
Ext.Element.VISIBILITY = 1;
Ext.Element.DISPLAY = 2;
Ext.Element.OFFSETS = 3;
Ext.Element.ASCLASS = 4;
Ext.Element.visibilityCls = 'x-hide-nosize';
share/ext/ext-all-debug.js view on Meta::CPAN
e = els[i];
if(e) {
Ext.EventManager.on(e, eventName, handler, scope || e, opt);
}
}
return this;
},
each : function(fn, scope){
var me = this,
els = me.elements,
len = els.length,
i, e;
for(i = 0; i<len; i++) {
e = els[i];
if(e){
e = this.getElement(e);
if(fn.call(scope || e, e, me, i) === false){
break;
}
}
}
return me;
},
fill : function(els){
var me = this;
me.elements = [];
me.add(els);
return me;
},
filter : function(selector){
var els = [],
me = this,
fn = Ext.isFunction(selector) ? selector
: function(el){
return el.is(selector);
};
me.each(function(el, self, i) {
if (fn(el, i) !== false) {
els[els.length] = me.transformElement(el);
}
});
me.elements = els;
return me;
},
indexOf : function(el){
return this.elements.indexOf(this.transformElement(el));
},
replaceElement : function(el, replacement, domReplace){
var index = !isNaN(el) ? el : this.indexOf(el),
d;
if(index > -1){
replacement = Ext.getDom(replacement);
if(domReplace){
d = this.elements[index];
d.parentNode.insertBefore(replacement, d);
Ext.removeNode(d);
}
this.elements.splice(index, 1, replacement);
}
return this;
},
clear : function(){
this.elements = [];
}
};
Ext.CompositeElementLite.prototype.on = Ext.CompositeElementLite.prototype.addListener;
Ext.CompositeElementLite.importElementMethods = function() {
var fnName,
ElProto = Ext.Element.prototype,
CelProto = Ext.CompositeElementLite.prototype;
for (fnName in ElProto) {
if (typeof ElProto[fnName] == 'function'){
(function(fnName) {
CelProto[fnName] = CelProto[fnName] || function() {
return this.invoke(fnName, arguments);
};
}).call(CelProto, fnName);
}
}
};
Ext.CompositeElementLite.importElementMethods();
if(Ext.DomQuery){
Ext.Element.selectorFunction = Ext.DomQuery.select;
}
Ext.Element.select = function(selector, root){
var els;
if(typeof selector == "string"){
els = Ext.Element.selectorFunction(selector, root);
}else if(selector.length !== undefined){
els = selector;
}else{
throw "Invalid selector";
}
return new Ext.CompositeElementLite(els);
};
Ext.select = Ext.Element.select;
(function(){
share/ext/ext-all-debug.js view on Meta::CPAN
this.buildScriptTag(file, onFileLoaded)
);
}, this);
head.appendChild(fragment);
}
},
buildScriptTag: function(filename, callback) {
var script = document.createElement('script');
script.type = "text/javascript";
script.src = filename;
if (script.readyState) {
script.onreadystatechange = function() {
if (script.readyState == "loaded" || script.readyState == "complete") {
script.onreadystatechange = null;
callback();
}
};
} else {
script.onload = callback;
}
return script;
}
});
Ext.ns("Ext.grid", "Ext.list", "Ext.dd", "Ext.tree", "Ext.form", "Ext.menu",
"Ext.state", "Ext.layout", "Ext.app", "Ext.ux", "Ext.chart", "Ext.direct");
Ext.apply(Ext, function(){
var E = Ext,
idSeed = 0,
scrollWidth = null;
return {
emptyFn : function(){},
BLANK_IMAGE_URL : Ext.isIE6 || Ext.isIE7 || Ext.isAir ?
'http:/' + '/www.extjs.com/s.gif' :
'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==',
extendX : function(supr, fn){
return Ext.extend(supr, fn(supr.prototype));
},
getDoc : function(){
return Ext.get(document);
},
num : function(v, defaultValue){
v = Number(Ext.isEmpty(v) || Ext.isArray(v) || typeof v == 'boolean' || (typeof v == 'string' && v.trim().length == 0) ? NaN : v);
return isNaN(v) ? defaultValue : v;
},
value : function(v, defaultValue, allowBlank){
return Ext.isEmpty(v, allowBlank) ? defaultValue : v;
},
escapeRe : function(s) {
return s.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1");
},
sequence : function(o, name, fn, scope){
o[name] = o[name].createSequence(fn, scope);
},
addBehaviors : function(o){
if(!Ext.isReady){
Ext.onReady(function(){
Ext.addBehaviors(o);
});
} else {
var cache = {},
parts,
b,
s;
for (b in o) {
if ((parts = b.split('@'))[1]) {
s = parts[0];
if(!cache[s]){
cache[s] = Ext.select(s);
}
cache[s].on(parts[1], o[b]);
}
}
cache = null;
}
},
getScrollBarWidth: function(force){
if(!Ext.isReady){
return 0;
}
if(force === true || scrollWidth === null){
var div = Ext.getBody().createChild('<div class="x-hide-offsets" style="width:100px;height:50px;overflow:hidden;"><div style="height:200px;"></div></div>'),
child = div.child('div', true);
var w1 = child.offsetWidth;
div.setStyle('overflow', (Ext.isWebKit || Ext.isGecko) ? 'auto' : 'scroll');
var w2 = child.offsetWidth;
div.remove();
scrollWidth = w1 - w2 + 2;
}
return scrollWidth;
},
share/ext/ext-all-debug.js view on Meta::CPAN
});
Ext.Element.prototype.getUpdateManager = Ext.Element.prototype.getUpdater;
Ext.Element.addMethods({
getAnchorXY : function(anchor, local, s){
anchor = (anchor || "tl").toLowerCase();
s = s || {};
var me = this,
vp = me.dom == document.body || me.dom == document,
w = s.width || vp ? Ext.lib.Dom.getViewWidth() : me.getWidth(),
h = s.height || vp ? Ext.lib.Dom.getViewHeight() : me.getHeight(),
xy,
r = Math.round,
o = me.getXY(),
scroll = me.getScroll(),
extraX = vp ? scroll.left : !local ? o[0] : 0,
extraY = vp ? scroll.top : !local ? o[1] : 0,
hash = {
c : [r(w * 0.5), r(h * 0.5)],
t : [r(w * 0.5), 0],
l : [0, r(h * 0.5)],
r : [w, r(h * 0.5)],
b : [r(w * 0.5), h],
tl : [0, 0],
bl : [0, h],
br : [w, h],
tr : [w, 0]
};
xy = hash[anchor];
return [xy[0] + extraX, xy[1] + extraY];
},
anchorTo : function(el, alignment, offsets, animate, monitorScroll, callback){
var me = this,
dom = me.dom,
scroll = !Ext.isEmpty(monitorScroll),
action = function(){
Ext.fly(dom).alignTo(el, alignment, offsets, animate);
Ext.callback(callback, Ext.fly(dom));
},
anchor = this.getAnchor();
this.removeAnchor();
Ext.apply(anchor, {
fn: action,
scroll: scroll
});
Ext.EventManager.onWindowResize(action, null);
if(scroll){
Ext.EventManager.on(window, 'scroll', action, null,
{buffer: !isNaN(monitorScroll) ? monitorScroll : 50});
}
action.call(me);
return me;
},
removeAnchor : function(){
var me = this,
anchor = this.getAnchor();
if(anchor && anchor.fn){
Ext.EventManager.removeResizeListener(anchor.fn);
if(anchor.scroll){
Ext.EventManager.un(window, 'scroll', anchor.fn);
}
delete anchor.fn;
}
return me;
},
getAnchor : function(){
var data = Ext.Element.data,
dom = this.dom;
if (!dom) {
return;
}
var anchor = data(dom, '_anchor');
if(!anchor){
anchor = data(dom, '_anchor', {});
}
return anchor;
},
getAlignToXY : function(el, p, o){
el = Ext.get(el);
if(!el || !el.dom){
throw "Element.alignToXY with an element that doesn't exist";
}
o = o || [0,0];
p = (!p || p == "?" ? "tl-bl?" : (!(/-/).test(p) && p !== "" ? "tl-" + p : p || "tl-bl")).toLowerCase();
var me = this,
d = me.dom,
a1,
a2,
x,
y,
w,
h,
r,
dw = Ext.lib.Dom.getViewWidth() -10,
dh = Ext.lib.Dom.getViewHeight()-10,
p1y,
p1x,
share/ext/ext-all-debug.js view on Meta::CPAN
for (var hr = 1, c = this.add(Date.HOUR, hr); c.getDate() != d; hr++, c = this.add(Date.HOUR, hr));
this.setDate(d);
this.setHours(c.getHours());
}
return this;
},
add : function(interval, value) {
var d = this.clone();
if (!interval || value === 0) return d;
switch(interval.toLowerCase()) {
case Date.MILLI:
d.setMilliseconds(this.getMilliseconds() + value);
break;
case Date.SECOND:
d.setSeconds(this.getSeconds() + value);
break;
case Date.MINUTE:
d.setMinutes(this.getMinutes() + value);
break;
case Date.HOUR:
d.setHours(this.getHours() + value);
break;
case Date.DAY:
d.setDate(this.getDate() + value);
break;
case Date.MONTH:
var day = this.getDate();
if (day > 28) {
day = Math.min(day, this.getFirstDateOfMonth().add('mo', value).getLastDateOfMonth().getDate());
}
d.setDate(day);
d.setMonth(this.getMonth() + value);
break;
case Date.YEAR:
d.setFullYear(this.getFullYear() + value);
break;
}
return d;
},
between : function(start, end) {
var t = this.getTime();
return start.getTime() <= t && t <= end.getTime();
}
});
Date.prototype.format = Date.prototype.dateFormat;
if (Ext.isSafari && (navigator.userAgent.match(/WebKit\/(\d+)/)[1] || NaN) < 420) {
Ext.apply(Date.prototype, {
_xMonth : Date.prototype.setMonth,
_xDate : Date.prototype.setDate,
setMonth : function(num) {
if (num <= -1) {
var n = Math.ceil(-num),
back_year = Math.ceil(n / 12),
month = (n % 12) ? 12 - n % 12 : 0;
this.setFullYear(this.getFullYear() - back_year);
return this._xMonth(month);
} else {
return this._xMonth(num);
}
},
setDate : function(d) {
return this.setTime(this.getTime() - (this.getDate() - d) * 864e5);
}
});
}
Ext.util.MixedCollection = function(allowFunctions, keyFn){
this.items = [];
this.map = {};
this.keys = [];
this.length = 0;
this.addEvents(
'clear',
'add',
'replace',
'remove',
'sort'
);
this.allowFunctions = allowFunctions === true;
if(keyFn){
this.getKey = keyFn;
}
Ext.util.MixedCollection.superclass.constructor.call(this);
};
Ext.extend(Ext.util.MixedCollection, Ext.util.Observable, {
share/ext/ext-all-debug.js view on Meta::CPAN
v = new Date(Date.parse(v));
}
return v.dateFormat(format || "m/d/Y");
},
dateRenderer : function(format) {
return function(v) {
return Ext.util.Format.date(v, format);
};
},
stripTags : function(v) {
return !v ? v : String(v).replace(stripTagsRE, "");
},
stripScripts : function(v) {
return !v ? v : String(v).replace(stripScriptsRe, "");
},
fileSize : function(size) {
if (size < 1024) {
return size + " bytes";
} else if (size < 1048576) {
return (Math.round(((size*10) / 1024))/10) + " KB";
} else {
return (Math.round(((size*10) / 1048576))/10) + " MB";
}
},
math : function(){
var fns = {};
return function(v, a){
if (!fns[a]) {
fns[a] = new Function('v', 'return v ' + a + ';');
}
return fns[a](v);
};
}(),
round : function(value, precision) {
var result = Number(value);
if (typeof precision == 'number') {
precision = Math.pow(10, precision);
result = Math.round(value * precision) / precision;
}
return result;
},
number: function(v, format) {
if (!format) {
return v;
}
v = Ext.num(v, NaN);
if (isNaN(v)) {
return '';
}
var comma = ',',
dec = '.',
i18n = false,
neg = v < 0;
v = Math.abs(v);
if (format.substr(format.length - 2) == '/i') {
format = format.substr(0, format.length - 2);
i18n = true;
comma = '.';
dec = ',';
}
var hasComma = format.indexOf(comma) != -1,
psplit = (i18n ? format.replace(/[^\d\,]/g, '') : format.replace(/[^\d\.]/g, '')).split(dec);
if (1 < psplit.length) {
v = v.toFixed(psplit[1].length);
} else if(2 < psplit.length) {
throw ('NumberFormatException: invalid format, formats should have no more than 1 period: ' + format);
} else {
v = v.toFixed(0);
}
var fnum = v.toString();
psplit = fnum.split('.');
if (hasComma) {
var cnum = psplit[0],
parr = [],
j = cnum.length,
m = Math.floor(j / 3),
n = cnum.length % 3 || 3,
i;
for (i = 0; i < j; i += n) {
if (i != 0) {
n = 3;
}
parr[parr.length] = cnum.substr(i, n);
m -= 1;
}
fnum = parr.join(comma);
if (psplit[1]) {
fnum += dec + psplit[1];
}
} else {
if (psplit[1]) {
fnum = psplit[0] + dec + psplit[1];
}
}
return (neg ? '-' : '') + format.replace(/[\d,?\.?]+/, fnum);
},
share/ext/ext-all-debug.js view on Meta::CPAN
if(!anchorSpec){
anchorsArray = component.anchor.split(' ');
component.anchorSpec = anchorSpec = {
right: this.parseAnchor(anchorsArray[0], component.initialConfig.width, anchorWidth),
bottom: this.parseAnchor(anchorsArray[1], component.initialConfig.height, anchorHeight)
};
}
calcWidth = anchorSpec.right ? this.adjustWidthAnchor(anchorSpec.right(containerWidth) - el.getMargins('lr'), component) : undefined;
calcHeight = anchorSpec.bottom ? this.adjustHeightAnchor(anchorSpec.bottom(containerHeight) - el.getMargins('tb'), component) : undefined;
if(calcWidth || calcHeight) {
boxes.push({
component: component,
width: calcWidth || undefined,
height: calcHeight || undefined
});
}
}
}
for (i = 0, len = boxes.length; i < len; i++) {
box = boxes[i];
box.component.setSize(box.width, box.height);
}
if (overflow && overflow != 'hidden' && !this.adjustmentPass) {
var newTargetSize = this.getLayoutTargetSize();
if (newTargetSize.width != size.width || newTargetSize.height != size.height){
this.adjustmentPass = true;
this.onLayout(container, target);
}
}
delete this.adjustmentPass;
},
parseAnchor : function(a, start, cstart) {
if (a && a != 'none') {
var last;
if (this.parseAnchorRE.test(a)) {
var diff = cstart - start;
return function(v){
if(v !== last){
last = v;
return v - diff;
}
};
} else if(a.indexOf('%') != -1) {
var ratio = parseFloat(a.replace('%', ''))*.01;
return function(v){
if(v !== last){
last = v;
return Math.floor(v*ratio);
}
};
} else {
a = parseInt(a, 10);
if (!isNaN(a)) {
return function(v) {
if (v !== last) {
last = v;
return v + a;
}
};
}
}
}
return false;
},
adjustWidthAnchor : function(value, comp){
return value;
},
adjustHeightAnchor : function(value, comp){
return value;
}
});
Ext.Container.LAYOUTS['anchor'] = Ext.layout.AnchorLayout;
Ext.layout.ColumnLayout = Ext.extend(Ext.layout.ContainerLayout, {
monitorResize:true,
type: 'column',
extraCls: 'x-column',
scrollOffset : 0,
targetCls: 'x-column-layout-ct',
isValidParent : function(c, target){
return this.innerCt && c.getPositionEl().dom.parentNode == this.innerCt.dom;
},
getLayoutTargetSize : function() {
var target = this.container.getLayoutTarget(), ret;
if (target) {
ret = target.getViewSize();
if (Ext.isIE && Ext.isStrict && ret.width == 0){
ret = target.getStyleSize();
}
ret.width -= target.getPadding('lr');
ret.height -= target.getPadding('tb');
}
return ret;
share/ext/ext-all-debug.js view on Meta::CPAN
if (constructor[this.type]) {
constructor = constructor[this.type];
}
this.overflowHandler = new constructor(this, handler);
},
onLayout: function(container, target) {
Ext.layout.BoxLayout.superclass.onLayout.call(this, container, target);
var tSize = this.getLayoutTargetSize(),
items = this.getVisibleItems(container),
calcs = this.calculateChildBoxes(items, tSize),
boxes = calcs.boxes,
meta = calcs.meta;
if (tSize.width > 0) {
var handler = this.overflowHandler,
method = meta.tooNarrow ? 'handleOverflow' : 'clearOverflow';
var results = handler[method](calcs, tSize);
if (results) {
if (results.targetSize) {
tSize = results.targetSize;
}
if (results.recalculate) {
items = this.getVisibleItems(container);
calcs = this.calculateChildBoxes(items, tSize);
boxes = calcs.boxes;
}
}
}
this.layoutTargetLastSize = tSize;
this.childBoxCache = calcs;
this.updateInnerCtSize(tSize, calcs);
this.updateChildBoxes(boxes);
this.handleTargetOverflow(tSize, container, target);
},
updateChildBoxes: function(boxes) {
for (var i = 0, length = boxes.length; i < length; i++) {
var box = boxes[i],
comp = box.component;
if (box.dirtySize) {
comp.setSize(box.width, box.height);
}
if (isNaN(box.left) || isNaN(box.top)) {
continue;
}
comp.setPosition(box.left, box.top);
}
},
updateInnerCtSize: function(tSize, calcs) {
var align = this.align,
padding = this.padding,
width = tSize.width,
height = tSize.height;
if (this.type == 'hbox') {
var innerCtWidth = width,
innerCtHeight = calcs.meta.maxHeight + padding.top + padding.bottom;
if (align == 'stretch') {
innerCtHeight = height;
} else if (align == 'middle') {
innerCtHeight = Math.max(height, innerCtHeight);
}
} else {
var innerCtHeight = height,
innerCtWidth = calcs.meta.maxWidth + padding.left + padding.right;
if (align == 'stretch') {
innerCtWidth = width;
} else if (align == 'center') {
innerCtWidth = Math.max(width, innerCtWidth);
}
}
this.innerCt.setSize(innerCtWidth || undefined, innerCtHeight || undefined);
},
handleTargetOverflow: function(previousTargetSize, container, target) {
var overflow = target.getStyle('overflow');
if (overflow && overflow != 'hidden' &&!this.adjustmentPass) {
var newTargetSize = this.getLayoutTargetSize();
if (newTargetSize.width != previousTargetSize.width || newTargetSize.height != previousTargetSize.height){
this.adjustmentPass = true;
this.onLayout(container, target);
}
}
delete this.adjustmentPass;
},
isValidParent : function(c, target) {
return this.innerCt && c.getPositionEl().dom.parentNode == this.innerCt.dom;
},
getVisibleItems: function(ct) {
var ct = ct || this.container,
share/ext/ext-all-debug.js view on Meta::CPAN
};
Ext.data.Api.Error = Ext.extend(Ext.Error, {
constructor : function(message, arg) {
this.arg = arg;
Ext.Error.call(this, message);
},
name: 'Ext.data.Api'
});
Ext.apply(Ext.data.Api.Error.prototype, {
lang: {
'action-url-undefined': 'No fallback url defined for this action. When defining a DataProxy api, please be sure to define an url for each CRUD action in Ext.data.Api.actions or define a default url in addition to your api-configuration.',
'invalid': 'received an invalid API-configuration. Please ensure your proxy API-configuration contains only the actions defined in Ext.data.Api.actions',
'invalid-url': 'Invalid url. Please review your proxy configuration.',
'execute': 'Attempted to execute an unknown action. Valid API actions are defined in Ext.data.Api.actions"'
}
});
Ext.data.SortTypes = {
none : function(s){
return s;
},
stripTagsRE : /<\/?[^>]+>/gi,
asText : function(s){
return String(s).replace(this.stripTagsRE, "");
},
asUCText : function(s){
return String(s).toUpperCase().replace(this.stripTagsRE, "");
},
asUCString : function(s) {
return String(s).toUpperCase();
},
asDate : function(s) {
if(!s){
return 0;
}
if(Ext.isDate(s)){
return s.getTime();
}
return Date.parse(String(s));
},
asFloat : function(s) {
var val = parseFloat(String(s).replace(/,/g, ""));
return isNaN(val) ? 0 : val;
},
asInt : function(s) {
var val = parseInt(String(s).replace(/,/g, ""), 10);
return isNaN(val) ? 0 : val;
}
};
Ext.data.Record = function(data, id){
this.id = (id || id === 0) ? id : Ext.data.Record.id(this);
this.data = data || {};
};
Ext.data.Record.create = function(o){
var f = Ext.extend(Ext.data.Record, {});
var p = f.prototype;
p.fields = new Ext.util.MixedCollection(false, function(field){
return field.name;
});
for(var i = 0, len = o.length; i < len; i++){
p.fields.add(new Ext.data.Field(o[i]));
}
f.getField = function(name){
return p.fields.get(name);
};
return f;
};
Ext.data.Record.PREFIX = 'ext-record';
Ext.data.Record.AUTO_ID = 1;
Ext.data.Record.EDIT = 'edit';
Ext.data.Record.REJECT = 'reject';
Ext.data.Record.COMMIT = 'commit';
Ext.data.Record.id = function(rec) {
rec.phantom = true;
return [Ext.data.Record.PREFIX, '-', Ext.data.Record.AUTO_ID++].join('');
};
Ext.data.Record.prototype = {
dirty : false,
editing : false,
error : null,
modified : null,
phantom : false,
join : function(store){
this.store = store;
},
set : function(name, value){
share/ext/ext-all-debug.js view on Meta::CPAN
Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, {
read : function(response){
var json = response.responseText;
var o = Ext.decode(json);
if(!o) {
throw {message: 'JsonReader.read: Json object not found'};
}
return this.readRecords(o);
},
readResponse : function(action, response) {
var o = (response.responseText !== undefined) ? Ext.decode(response.responseText) : response;
if(!o) {
throw new Ext.data.JsonReader.Error('response');
}
var root = this.getRoot(o);
if (action === Ext.data.Api.actions.create) {
var def = Ext.isDefined(root);
if (def && Ext.isEmpty(root)) {
throw new Ext.data.JsonReader.Error('root-empty', this.meta.root);
}
else if (!def) {
throw new Ext.data.JsonReader.Error('root-undefined-response', this.meta.root);
}
}
var res = new Ext.data.Response({
action: action,
success: this.getSuccess(o),
data: (root) ? this.extractData(root, false) : [],
message: this.getMessage(o),
raw: o
});
if (Ext.isEmpty(res.success)) {
throw new Ext.data.JsonReader.Error('successProperty-response', this.meta.successProperty);
}
return res;
},
readRecords : function(o){
this.jsonData = o;
if(o.metaData){
this.onMetaChange(o.metaData);
}
var s = this.meta, Record = this.recordType,
f = Record.prototype.fields, fi = f.items, fl = f.length, v;
var root = this.getRoot(o), c = root.length, totalRecords = c, success = true;
if(s.totalProperty){
v = parseInt(this.getTotal(o), 10);
if(!isNaN(v)){
totalRecords = v;
}
}
if(s.successProperty){
v = this.getSuccess(o);
if(v === false || v === 'false'){
success = false;
}
}
return {
success : success,
records : this.extractData(root, true),
totalRecords : totalRecords
};
},
buildExtractors : function() {
if(this.ef){
return;
}
var s = this.meta, Record = this.recordType,
f = Record.prototype.fields, fi = f.items, fl = f.length;
if(s.totalProperty) {
this.getTotal = this.createAccessor(s.totalProperty);
}
if(s.successProperty) {
this.getSuccess = this.createAccessor(s.successProperty);
}
if (s.messageProperty) {
this.getMessage = this.createAccessor(s.messageProperty);
}
this.getRoot = s.root ? this.createAccessor(s.root) : function(p){return p;};
if (s.id || s.idProperty) {
var g = this.createAccessor(s.id || s.idProperty);
this.getId = function(rec) {
var r = g(rec);
return (r === undefined || r === '') ? null : r;
};
} else {
this.getId = function(){return null;};
}
var ef = [];
for(var i = 0; i < fl; i++){
f = fi[i];
var map = (f.mapping !== undefined && f.mapping !== null) ? f.mapping : f.name;
ef.push(this.createAccessor(map));
}
this.ef = ef;
},
simpleAccess : function(obj, subsc) {
return obj[subsc];
},
share/ext/ext-all-debug.js view on Meta::CPAN
}
return values;
}
});
Ext.data.JsonReader.Error = Ext.extend(Ext.Error, {
constructor : function(message, arg) {
this.arg = arg;
Ext.Error.call(this, message);
},
name : 'Ext.data.JsonReader'
});
Ext.apply(Ext.data.JsonReader.Error.prototype, {
lang: {
'response': 'An error occurred while json-decoding your server response',
'successProperty-response': 'Could not locate your "successProperty" in your server response. Please review your JsonReader config to ensure the config-property "successProperty" matches the property in your server-response. See the JsonRea...
'root-undefined-config': 'Your JsonReader was configured without a "root" property. Please review your JsonReader config and make sure to define the root property. See the JsonReader docs.',
'idProperty-undefined' : 'Your JsonReader was configured without an "idProperty" Please review your JsonReader configuration and ensure the "idProperty" is set (e.g.: "id"). See the JsonReader docs.',
'root-empty': 'Data was expected to be returned by the server in the "root" property of the response. Please review your JsonReader configuration to ensure the "root" property matches that returned in the server-response. See JsonReader doc...
}
});
Ext.data.ArrayReader = Ext.extend(Ext.data.JsonReader, {
readRecords : function(o){
this.arrayData = o;
var s = this.meta,
sid = s ? Ext.num(s.idIndex, s.id) : null,
recordType = this.recordType,
fields = recordType.prototype.fields,
records = [],
success = true,
v;
var root = this.getRoot(o);
for(var i = 0, len = root.length; i < len; i++) {
var n = root[i],
values = {},
id = ((sid || sid === 0) && n[sid] !== undefined && n[sid] !== "" ? n[sid] : null);
for(var j = 0, jlen = fields.length; j < jlen; j++) {
var f = fields.items[j],
k = f.mapping !== undefined && f.mapping !== null ? f.mapping : j;
v = n[k] !== undefined ? n[k] : f.defaultValue;
v = f.convert(v, n);
values[f.name] = v;
}
var record = new recordType(values, id);
record.json = n;
records[records.length] = record;
}
var totalRecords = records.length;
if(s.totalProperty) {
v = parseInt(this.getTotal(o), 10);
if(!isNaN(v)) {
totalRecords = v;
}
}
if(s.successProperty){
v = this.getSuccess(o);
if(v === false || v === 'false'){
success = false;
}
}
return {
success : success,
records : records,
totalRecords : totalRecords
};
}
});
Ext.data.ArrayStore = Ext.extend(Ext.data.Store, {
constructor: function(config){
Ext.data.ArrayStore.superclass.constructor.call(this, Ext.apply(config, {
reader: new Ext.data.ArrayReader(config)
}));
},
loadData : function(data, append){
if(this.expandData === true){
var r = [];
for(var i = 0, len = data.length; i < len; i++){
r[r.length] = [data[i]];
}
data = r;
}
Ext.data.ArrayStore.superclass.loadData.call(this, data, append);
}
});
Ext.reg('arraystore', Ext.data.ArrayStore);
Ext.data.SimpleStore = Ext.data.ArrayStore;
Ext.reg('simplestore', Ext.data.SimpleStore);
Ext.data.JsonStore = Ext.extend(Ext.data.Store, {
constructor: function(config){
Ext.data.JsonStore.superclass.constructor.call(this, Ext.apply(config, {
reader: new Ext.data.JsonReader(config)
}));
}
});
Ext.reg('jsonstore', Ext.data.JsonStore);
Ext.data.XmlWriter = function(params) {
Ext.data.XmlWriter.superclass.constructor.apply(this, arguments);
this.tpl = (typeof(this.tpl) === 'string') ? new Ext.XTemplate(this.tpl).compile() : this.tpl.compile();
};
Ext.extend(Ext.data.XmlWriter, Ext.data.DataWriter, {
documentRoot: 'xrequest',
forceDocumentRoot: false,
share/ext/ext-all-debug.js view on Meta::CPAN
updateInfo : function(){
if(this.displayItem){
var count = this.store.getCount();
var msg = count == 0 ?
this.emptyMsg :
String.format(
this.displayMsg,
this.cursor+1, this.cursor+count, this.store.getTotalCount()
);
this.displayItem.setText(msg);
}
},
onLoad : function(store, r, o){
if(!this.rendered){
this.dsLoaded = [store, r, o];
return;
}
var p = this.getParams();
this.cursor = (o.params && o.params[p.start]) ? o.params[p.start] : 0;
var d = this.getPageData(), ap = d.activePage, ps = d.pages;
this.afterTextItem.setText(String.format(this.afterPageText, d.pages));
this.inputItem.setValue(ap);
this.first.setDisabled(ap == 1);
this.prev.setDisabled(ap == 1);
this.next.setDisabled(ap == ps);
this.last.setDisabled(ap == ps);
this.refresh.enable();
this.updateInfo();
this.fireEvent('change', this, d);
},
getPageData : function(){
var total = this.store.getTotalCount();
return {
total : total,
activePage : Math.ceil((this.cursor+this.pageSize)/this.pageSize),
pages : total < this.pageSize ? 1 : Math.ceil(total/this.pageSize)
};
},
changePage : function(page){
this.doLoad(((page-1) * this.pageSize).constrain(0, this.store.getTotalCount()));
},
onLoadError : function(){
if(!this.rendered){
return;
}
this.refresh.enable();
},
readPage : function(d){
var v = this.inputItem.getValue(), pageNum;
if (!v || isNaN(pageNum = parseInt(v, 10))) {
this.inputItem.setValue(d.activePage);
return false;
}
return pageNum;
},
onPagingFocus : function(){
this.inputItem.select();
},
onPagingBlur : function(e){
this.inputItem.setValue(this.getPageData().activePage);
},
onPagingKeyDown : function(field, e){
var k = e.getKey(), d = this.getPageData(), pageNum;
if (k == e.RETURN) {
e.stopEvent();
pageNum = this.readPage(d);
if(pageNum !== false){
pageNum = Math.min(Math.max(1, pageNum), d.pages) - 1;
this.doLoad(pageNum * this.pageSize);
}
}else if (k == e.HOME || k == e.END){
e.stopEvent();
pageNum = k == e.HOME ? 1 : d.pages;
field.setValue(pageNum);
}else if (k == e.UP || k == e.PAGEUP || k == e.DOWN || k == e.PAGEDOWN){
e.stopEvent();
if((pageNum = this.readPage(d))){
var increment = e.shiftKey ? 10 : 1;
if(k == e.DOWN || k == e.PAGEDOWN){
increment *= -1;
}
pageNum += increment;
if(pageNum >= 1 & pageNum <= d.pages){
field.setValue(pageNum);
}
}
}
},
getParams : function(){
return this.paramNames || this.store.paramNames;
},
beforeLoad : function(){
if(this.rendered && this.refresh){
this.refresh.disable();
}
},
doLoad : function(start){
var o = {}, pn = this.getParams();
share/ext/ext-all-debug.js view on Meta::CPAN
});
Ext.reg('linechart', Ext.chart.LineChart);
Ext.chart.ColumnChart = Ext.extend(Ext.chart.CartesianChart, {
type: 'column'
});
Ext.reg('columnchart', Ext.chart.ColumnChart);
Ext.chart.StackedColumnChart = Ext.extend(Ext.chart.CartesianChart, {
type: 'stackcolumn'
});
Ext.reg('stackedcolumnchart', Ext.chart.StackedColumnChart);
Ext.chart.BarChart = Ext.extend(Ext.chart.CartesianChart, {
type: 'bar'
});
Ext.reg('barchart', Ext.chart.BarChart);
Ext.chart.StackedBarChart = Ext.extend(Ext.chart.CartesianChart, {
type: 'stackbar'
});
Ext.reg('stackedbarchart', Ext.chart.StackedBarChart);
Ext.chart.Axis = function(config){
Ext.apply(this, config);
};
Ext.chart.Axis.prototype =
{
type: null,
orientation: "horizontal",
reverse: false,
labelFunction: null,
hideOverlappingLabels: true,
labelSpacing: 2
};
Ext.chart.NumericAxis = Ext.extend(Ext.chart.Axis, {
type: "numeric",
minimum: NaN,
maximum: NaN,
majorUnit: NaN,
minorUnit: NaN,
snapToUnits: true,
alwaysShowZero: true,
scale: "linear",
roundMajorUnit: true,
calculateByLabelSize: true,
position: 'left',
adjustMaximumByMajorUnit: true,
adjustMinimumByMajorUnit: true
});
Ext.chart.TimeAxis = Ext.extend(Ext.chart.Axis, {
type: "time",
minimum: null,
maximum: null,
majorUnit: NaN,
majorTimeUnit: null,
minorUnit: NaN,
minorTimeUnit: null,
snapToUnits: true,
stackingEnabled: false,
calculateByLabelSize: true
});
Ext.chart.CategoryAxis = Ext.extend(Ext.chart.Axis, {
type: "category",
categoryNames: null,
calculateCategoryCount: false
});
Ext.chart.Series = function(config) { Ext.apply(this, config); };
Ext.chart.Series.prototype =
{
type: null,
displayName: null
};
Ext.chart.CartesianSeries = Ext.extend(Ext.chart.Series, {
xField: null,
yField: null,
showInLegend: true,
axis: 'primary'
});
Ext.chart.ColumnSeries = Ext.extend(Ext.chart.CartesianSeries, {
type: "column"
});
share/ext/ext-all-debug.js view on Meta::CPAN
decimalSeparator : ".",
decimalPrecision : 2,
allowNegative : true,
minValue : Number.NEGATIVE_INFINITY,
maxValue : Number.MAX_VALUE,
minText : "The minimum value for this field is {0}",
maxText : "The maximum value for this field is {0}",
nanText : "{0} is not a valid number",
baseChars : "0123456789",
autoStripChars: false,
initEvents : function() {
var allowed = this.baseChars + '';
if (this.allowDecimals) {
allowed += this.decimalSeparator;
}
if (this.allowNegative) {
allowed += '-';
}
allowed = Ext.escapeRe(allowed);
this.maskRe = new RegExp('[' + allowed + ']');
if (this.autoStripChars) {
this.stripCharsRe = new RegExp('[^' + allowed + ']', 'gi');
}
Ext.form.NumberField.superclass.initEvents.call(this);
},
getErrors: function(value) {
var errors = Ext.form.NumberField.superclass.getErrors.apply(this, arguments);
value = Ext.isDefined(value) ? value : this.processValue(this.getRawValue());
if (value.length < 1) {
return errors;
}
value = String(value).replace(this.decimalSeparator, ".");
if(isNaN(value)){
errors.push(String.format(this.nanText, value));
}
var num = this.parseValue(value);
if (num < this.minValue) {
errors.push(String.format(this.minText, this.minValue));
}
if (num > this.maxValue) {
errors.push(String.format(this.maxText, this.maxValue));
}
return errors;
},
getValue : function() {
return this.fixPrecision(this.parseValue(Ext.form.NumberField.superclass.getValue.call(this)));
},
setValue : function(v) {
v = this.fixPrecision(v);
v = Ext.isNumber(v) ? v : parseFloat(String(v).replace(this.decimalSeparator, "."));
v = isNaN(v) ? '' : String(v).replace(".", this.decimalSeparator);
return Ext.form.NumberField.superclass.setValue.call(this, v);
},
setMinValue : function(value) {
this.minValue = Ext.num(value, Number.NEGATIVE_INFINITY);
},
setMaxValue : function(value) {
this.maxValue = Ext.num(value, Number.MAX_VALUE);
},
parseValue : function(value) {
value = parseFloat(String(value).replace(this.decimalSeparator, "."));
return isNaN(value) ? '' : value;
},
fixPrecision : function(value) {
var nan = isNaN(value);
if (!this.allowDecimals || this.decimalPrecision == -1 || nan || !value) {
return nan ? '' : value;
}
return parseFloat(parseFloat(value).toFixed(this.decimalPrecision));
},
beforeBlur : function() {
var v = this.parseValue(this.getRawValue());
if (!Ext.isEmpty(v)) {
this.setValue(v);
}
}
});
Ext.reg('numberfield', Ext.form.NumberField);
Ext.form.DateField = Ext.extend(Ext.form.TriggerField, {
format : "m/d/Y",
altFormats : "m/d/Y|n/j/Y|n/j/y|m/j/y|n/d/y|m/j/Y|n/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d|Y-m-d|n-j|n/j",
disabledDaysText : "Disabled",
disabledDatesText : "Disabled",
minText : "The date in this field must be equal to or after {0}",
maxText : "The date in this field must be equal to or before {0}",
invalidText : "{0} is not a valid date - it must be in the format {1}",
triggerClass : 'x-form-date-trigger',
showToday : true,
startDay : 0,
defaultAutoCreate : {tag: "input", type: "text", size: "10", autocomplete: "off"},
initTime: '12',
initTimeFormat: 'H',
safeParse : function(value, format) {
if (/[gGhH]/.test(format.replace(/(\\.)/g, ''))) {
share/ext/ext-all-debug.js view on Meta::CPAN
return true;
},
scope : this,
doRelay : function(e, h, hname){
if(hname == 'down' || this.scope.isExpanded()){
var relay = Ext.KeyNav.prototype.doRelay.apply(this, arguments);
if(!Ext.isIE && Ext.EventManager.useKeydown){
this.scope.fireKey(e);
}
return relay;
}
return true;
},
forceKeyDown : true,
defaultEventAction: 'stopEvent'
});
this.queryDelay = Math.max(this.queryDelay || 10,
this.mode == 'local' ? 10 : 250);
this.dqTask = new Ext.util.DelayedTask(this.initQuery, this);
if(this.typeAhead){
this.taTask = new Ext.util.DelayedTask(this.onTypeAhead, this);
}
if(!this.enableKeyEvents){
this.mon(this.el, 'keyup', this.onKeyUp, this);
}
},
onDestroy : function(){
if (this.dqTask){
this.dqTask.cancel();
this.dqTask = null;
}
this.bindStore(null);
Ext.destroy(
this.resizer,
this.view,
this.pageTb,
this.list
);
Ext.destroyMembers(this, 'hiddenField');
Ext.form.ComboBox.superclass.onDestroy.call(this);
},
fireKey : function(e){
if (!this.isExpanded()) {
Ext.form.ComboBox.superclass.fireKey.call(this, e);
}
},
onResize : function(w, h){
Ext.form.ComboBox.superclass.onResize.apply(this, arguments);
if(!isNaN(w) && this.isVisible() && this.list){
this.doResize(w);
}else{
this.bufferSize = w;
}
},
doResize: function(w){
if(!Ext.isDefined(this.listWidth)){
var lw = Math.max(w, this.minListWidth);
this.list.setWidth(lw);
this.innerList.setWidth(lw - this.list.getFrameWidth('lr'));
}
},
onEnable : function(){
Ext.form.ComboBox.superclass.onEnable.apply(this, arguments);
if(this.hiddenField){
this.hiddenField.disabled = false;
}
},
onDisable : function(){
Ext.form.ComboBox.superclass.onDisable.apply(this, arguments);
if(this.hiddenField){
this.hiddenField.disabled = true;
}
},
onBeforeLoad : function(){
if(!this.hasFocus){
return;
}
this.innerList.update(this.loadingText ?
'<div class="loading-indicator">'+this.loadingText+'</div>' : '');
this.restrictHeight();
this.selectedIndex = -1;
},
onLoad : function(){
if(!this.hasFocus){
return;
}
if(this.store.getCount() > 0 || this.listEmptyText){
this.expand();
this.restrictHeight();
if(this.lastQuery == this.allQuery){
if(this.editable){
this.el.dom.select();
}
if(this.autoSelect !== false && !this.selectByValue(this.value, true)){
this.select(0, true);
}
}else{
if(this.autoSelect !== false){
this.selectNext();
share/ext/ext-all-debug.js view on Meta::CPAN
focusEl.focus();
} else {
focusEl.focus.defer(1, focusEl);
}
},
resolveCell : function(row, col, hscroll) {
if (!Ext.isNumber(row)) {
row = row.rowIndex;
}
if (!this.ds) {
return null;
}
if (row < 0 || row >= this.ds.getCount()) {
return null;
}
col = (col !== undefined ? col : 0);
var rowEl = this.getRow(row),
colModel = this.cm,
colCount = colModel.getColumnCount(),
cellEl;
if (!(hscroll === false && col === 0)) {
while (col < colCount && colModel.isHidden(col)) {
col++;
}
cellEl = this.getCell(row, col);
}
return {row: rowEl, cell: cellEl};
},
getResolvedXY : function(resolved) {
if (!resolved) {
return null;
}
var cell = resolved.cell,
row = resolved.row;
if (cell) {
return Ext.fly(cell).getXY();
} else {
return [this.el.getX(), Ext.fly(row).getY()];
}
},
syncFocusEl : function(row, col, hscroll) {
var xy = row;
if (!Ext.isArray(xy)) {
row = Math.min(row, Math.max(0, this.getRows().length-1));
if (isNaN(row)) {
return;
}
xy = this.getResolvedXY(this.resolveCell(row, col, hscroll));
}
this.focusEl.setXY(xy || this.scroller.getXY());
},
ensureVisible : function(row, col, hscroll) {
var resolved = this.resolveCell(row, col, hscroll);
if (!resolved || !resolved.row) {
return null;
}
var rowEl = resolved.row,
cellEl = resolved.cell,
c = this.scroller.dom,
p = rowEl,
ctop = 0,
stop = this.el.dom;
while (p && p != stop) {
ctop += p.offsetTop;
p = p.offsetParent;
}
ctop -= this.mainHd.dom.offsetHeight;
stop = parseInt(c.scrollTop, 10);
var cbot = ctop + rowEl.offsetHeight,
ch = c.clientHeight,
sbot = stop + ch;
if (ctop < stop) {
c.scrollTop = ctop;
} else if(cbot > sbot) {
c.scrollTop = cbot-ch;
}
if (hscroll !== false) {
var cleft = parseInt(cellEl.offsetLeft, 10),
cright = cleft + cellEl.offsetWidth,
sleft = parseInt(c.scrollLeft, 10),
sright = sleft + c.clientWidth;
if (cleft < sleft) {
c.scrollLeft = cleft;
} else if(cright > sright) {
c.scrollLeft = cright-c.clientWidth;
}
}
return this.getResolvedXY(resolved);
},