Ext.fly(bd, '_internal').addClass(cls);
return true;
};
-
-
- Ext.isReady = initExtCss();
- if (!Ext.isReady) {
+ if (!initExtCss()) {
Ext.onReady(initExtCss);
}
})();
return new Ext.EventObjectImpl();
}();
+Ext.Loader = Ext.apply({}, {
+
+ load: function(fileList, callback, scope, preserveOrder) {
+ var scope = scope || this,
+ head = document.getElementsByTagName("head")[0],
+ fragment = document.createDocumentFragment(),
+ numFiles = fileList.length,
+ loadedFiles = 0,
+ me = this;
+
+
+ var loadFileIndex = function(index) {
+ head.appendChild(
+ me.buildScriptTag(fileList[index], onFileLoaded)
+ );
+ };
+
+
+ var onFileLoaded = function() {
+ loadedFiles ++;
+
+
+ if (numFiles == loadedFiles && typeof callback == 'function') {
+ callback.call(scope);
+ } else {
+ if (preserveOrder === true) {
+ loadFileIndex(loadedFiles);
+ }
+ }
+ };
+
+ if (preserveOrder === true) {
+ loadFileIndex.call(this, 0);
+ } else {
+
+ Ext.each(fileList, function(file, index) {
+ fragment.appendChild(
+ 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");
calc = [],
regex = [],
special = false,
- ch = "";
+ ch = "",
+ i = 0,
+ obj,
+ last;
- for (var i = 0; i < format.length; ++i) {
+ for (; i < format.length; ++i) {
ch = format.charAt(i);
if (!special && ch == "\\") {
special = true;
special = false;
regex.push(String.escape(ch));
} else {
- var obj = $f(ch, currentGroup);
+ obj = $f(ch, currentGroup);
currentGroup += obj.g;
regex.push(obj.s);
if (obj.g && obj.c) {
- calc.push(obj.c);
+ if (obj.calcLast) {
+ last = obj.c;
+ } else {
+ calc.push(obj.c);
+ }
}
}
}
+
+ if (last) {
+ calc.push(last);
+ }
Date.parseRegexes[regexNum] = new RegExp("^" + regex.join('') + "$", 'i');
Date.parseFunctions[format] = new Function("input", "strict", xf(code, regexNum, calc.join('')));
s:"(\\d{1,2})"
},
- a: {
- g:1,
- c:"if (/(am)/i.test(results[{0}])) {\n"
- + "if (!h || h == 12) { h = 0; }\n"
- + "} else { if (!h || h < 12) { h = (h || 0) + 12; }}",
- s:"(am|pm|AM|PM)"
+ a: function(){
+ return $f("A");
},
A: {
+
+ calcLast: true,
g:1,
c:"if (/(am)/i.test(results[{0}])) {\n"
+ "if (!h || h == 12) { h = 0; }\n"
c = Ext.ComponentMgr.get(c);
Ext.apply(c, d);
}else if(!c.events){
- Ext.applyIf(c, d);
+ Ext.applyIf(c.isAction ? c.initialConfig : c, d);
}else{
Ext.apply(c, d);
}
if(this.resizeTask && this.resizeTask.cancel){
this.resizeTask.cancel();
}
+ if(this.container) {
+ this.container.un(this.container.resizeEvent, this.onResize, this);
+ }
if(!Ext.isEmpty(this.targetCls)){
var target = this.container.getLayoutTarget();
if(target){
add : function(records) {
- var i, record, index;
+ var i, len, record, index;
records = [].concat(records);
if (records.length < 1) {
insert : function(index, records) {
- var i, record;
+ var i, len, record;
records = [].concat(records);
for (i = 0, len = records.length; i < len; i++) {
loadRecords : function(o, options, success){
- var i;
+ var i, len;
if (this.isDestroyed === true) {
return;
createAccessor : function(){
var q = Ext.DomQuery;
return function(key) {
+ if (Ext.isFunction(key)) {
+ return key;
+ }
switch(key) {
case this.meta.totalProperty:
return function(root, def){
groupOnSort:false,
+
groupDir : 'ASC',
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(
'menutriggerout'
);
- if(this.menu){
- this.menu = Ext.menu.MenuMgr.get(this.menu);
+
+ if (this.menu){
+ this.menu.ownerCt = undefined;
}
if(Ext.isString(this.toggleGroup)){
this.enableToggle = true;
Ext.chart.Chart.proxyFunction = {};
-Ext.chart.Chart.CHART_URL = 'http:/' + '/yui.yahooapis.com/2.8.0/build/charts/assets/charts.swf';
+Ext.chart.Chart.CHART_URL = 'http:/' + '/yui.yahooapis.com/2.8.2/build/charts/assets/charts.swf';
Ext.chart.PieChart = Ext.extend(Ext.chart.Chart, {
},
- assertValue : function(){
+ assertValue : function(){
var val = this.getRawValue(),
- rec = this.findRecord(this.displayField, val);
+ rec;
+ if(this.valueField && Ext.isDefined(this.value)){
+ rec = this.findRecord(this.valueField, this.value);
+ }
+ if(!rec || rec.get(this.displayField) != val){
+ rec = this.findRecord(this.displayField, val);
+ }
if(!rec && this.forceSelection){
if(val.length > 0 && val != this.emptyText){
this.el.dom.value = Ext.value(this.lastSelectionText, '');
this.clearValue();
}
}else{
- if(rec){
+ if(rec && this.valueField){
- if (val == rec.get(this.displayField) && this.value == rec.get(this.valueField)){
+ if (this.value == val){
return;
}
val = rec.get(this.valueField || this.displayField);
-
actionMode : 'wrap',
for (var i=0, j = items.length; i < j; i++) {
item = items[i];
+
+ if (!Ext.isEmpty(item.ref)){
+ item.ref = '../' + item.ref;
+ }
labels.push(item.fieldLabel);
layout : 'hbox',
items : this.items,
cls : 'x-form-composite',
- defaultMargins: '0 3 0 0'
+ defaultMargins: '0 3 0 0',
+ ownerCt: this
});
+ this.innerCt.ownerCt = undefined;
var fields = this.innerCt.findBy(function(c) {
return c.isFormField;
updateRecord : function(record){
record.beginEdit();
- var fs = record.fields;
+ var fs = record.fields,
+ field,
+ value;
fs.each(function(f){
- var field = this.findField(f.name);
+ field = this.findField(f.name);
if(field){
- var value = field.getValue();
- if ( value.getGroupValue ) {
+ value = field.getValue();
+ if (typeof value != undefined && value.getGroupValue) {
value = value.getGroupValue();
} else if ( field.eachItem ) {
value = [];
store = this.store,
s,
c,
- oldIndex;
+ colIndex;
if(cs){
for(var i = 0, len = cs.length; i < len; i++){
s = cs[i];
c = cm.getColumnById(s.id);
if(c){
- cm.setState(s.id, {
+ colIndex = cm.getIndexById(s.id);
+ cm.setState(colIndex, {
hidden: s.hidden,
- width: s.width
+ width: s.width,
+ sortable: s.sortable
});
- oldIndex = cm.getIndexById(s.id);
- if(oldIndex != i){
- cm.moveColumn(oldIndex, i);
+ if(colIndex != i){
+ cm.moveColumn(colIndex, i);
}
}
}
if(c.hidden){
o.columns[i].hidden = true;
}
+ if(c.sortable){
+ o.columns[i].sortable = true;
+ }
}
if(store){
ss = store.getSortState();
Ext.DomHelper.insertHtml('beforeEnd', this.mainBody.dom, html);
}
if (!isUpdate) {
- this.fireEvent('rowsinserted', this, firstRow, lastRow);
this.processRows(firstRow);
+ this.fireEvent('rowsinserted', this, firstRow, lastRow);
} else if (firstRow === 0 || firstRow >= last) {
Ext.fly(this.getRow(firstRow)).addClass(firstRow === 0 ? this.firstRowCls : this.lastRowCls);
s = this.getSelections(),
i = 0,
len = s.length,
- index;
+ index, r;
this.silent = true;
this.clearSelections(true);
r = newCell[0];
c = newCell[1];
- if(last.row != r){
- this.selectRow(r);
- }
+ this.onEditorSelect(r, last.row);
if(g.isEditor && g.editing){
ae = g.activeEditor;
}
},
+ onEditorSelect: function(row, lastRow){
+ if(lastRow != row){
+ this.selectRow(row);
+ }
+ },
+
destroy : function(){
Ext.destroy(this.rowNav);
this.rowNav = null;
Ext.grid.RowSelectionModel.superclass.destroy.call(this);
}
});
+
Ext.grid.Column = Ext.extend(Ext.util.Observable, {
renderer : function(v, p, record){
return '<div class="x-grid3-row-checker"> </div>';
+ },
+
+ onEditorSelect: function(row, lastRow){
+ if(lastRow != row && !this.checkOnly){
+ this.selectRow(row);
+ }
}
});
Ext.grid.CellSelectionModel = Ext.extend(Ext.grid.AbstractSelectionModel, {
onGroupByClick : function(){
+ var grid = this.grid;
this.enableGrouping = true;
- this.grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));
- this.grid.fireEvent('groupchange', this, this.grid.store.getGroupState());
+ grid.store.groupBy(this.cm.getDataIndex(this.hdCtxIndex));
+ grid.fireEvent('groupchange', grid, grid.store.getGroupState());
this.beforeMenuShow();
this.refresh();
},