javascripts/basepack.js in netzke-basepack-0.6.0 vs javascripts/basepack.js in netzke-basepack-0.6.1
- old
+ new
@@ -13,40 +13,40 @@
Ext.netzke.ComboBox = Ext.extend(Ext.form.ComboBox, {
displayField : 'id',
valueField : 'id',
triggerAction : 'all',
typeAhead : true,
-
+
initComponent : function(){
var row = Ext.data.Record.create([{name:'id'}]);
var store = new Ext.data.Store({
proxy : new Ext.data.HttpProxy({url: Ext.getCmp(this.parentId).endpointUrl("get_combobox_options"), jsonData:{column:this.name}}),
reader : new Ext.data.ArrayReader({root:'data', id:0}, row)
});
-
+
Ext.apply(this, {
store : store
});
-
+
Ext.netzke.ComboBox.superclass.initComponent.apply(this, arguments);
-
+
this.on('blur', function(cb){
cb.setValue(cb.getRawValue());
});
-
+
this.on('specialkey', function(cb, event){
if (event.getKey() == 9 || event.getKey() == 13) {cb.setValue(cb.getRawValue());}
});
var parent = Ext.getCmp(this.parentId);
// Is parent a grid?
if (parent.getSelectionModel) {
- this.on('beforequery',function(qe) {
- delete qe.combo.lastQuery;
- },this);
+ this.on('beforequery',function(qe) {
+ delete qe.combo.lastQuery;
+ },this);
}
-
+
// A not-so-clean approach to submit the current record id
store.on('beforeload',function(store, options){
if (parent.getSelectionModel) {
var selected = parent.getSelectionModel().getSelected();
if (selected) options.params.id = selected.get('id');
@@ -129,15 +129,15 @@
return true;
} catch(e) {
return "Invalid JSON"
}
}
-
+
,setValue: function(value) {
this.setRawValue(Ext.encode(value));
}
-
+
});
Ext.reg('jsonfield', Ext.netzke.JsonField);
/**
@@ -153,11 +153,11 @@
*
* @license Ext.ux.form.DateTime is licensed under the terms of
* the Open Source LGPL 3.0 license. Commercial use is permitted to the extent
* that the code/component(s) do NOT become part of another Open Source or Commercially
* licensed development library or toolkit without explicit permission.
- *
+ *
* <p>License details: <a href="http://www.gnu.org/licenses/lgpl.html"
* target="_blank">http://www.gnu.org/licenses/lgpl.html</a></p>
*
* @forum 22661
*/
@@ -367,11 +367,11 @@
} // eo function clearInvalid
// }}}
// {{{
/**
* @private
- * called from Component::destroy.
+ * called from Component::destroy.
* Destroys all elements and removes all listeners we've created.
*/
,beforeDestroy:function() {
if(this.isRendered) {
// this.removeAllListeners();
@@ -461,18 +461,18 @@
} // eo function isValid
// }}}
// {{{
/**
* Returns true if this component is visible
- * @return {boolean}
+ * @return {boolean}
*/
,isVisible : function(){
return this.df.rendered && this.df.getActionEl().isVisible();
} // eo function isVisible
// }}}
// {{{
- /**
+ /**
* @private Handles blur event
*/
,onBlur:function(f) {
// called by both DateField and TimeField blur events
@@ -558,11 +558,11 @@
,setDate:function(date) {
this.df.setValue(date);
} // eo function setDate
// }}}
// {{{
- /**
+ /**
* @private Sets the value of TimeField
*/
,setTime:function(date) {
this.tf.setValue(date);
} // eo function setTime
@@ -866,11 +866,11 @@
});
Ext.ns('Ext.ux.form');
Ext.ux.form.TriCheckbox = Ext.extend(Ext.form.Checkbox, {
checked: null,
- valueList: [null, false, true],
+ valueList: [null, false, true],
stateClassList: ['x-checkbox-undef', null, 'x-checkbox-checked'],
overClass: 'x-form-check-over',
clickClass: 'x-form-check-down',
triState: true,
defaultAutoCreate: {tag: 'input', type: 'hidden', autocomplete: 'off'},
@@ -891,37 +891,37 @@
}
this.value = this.normalizeValue(this.value);
},
onRender : function(ct, position){
Ext.form.Checkbox.superclass.onRender.call(this, ct, position);
-
+
this.innerWrap = this.el.wrap({tag: 'span', cls: 'x-form-check-innerwrap'});
this.wrap = this.innerWrap.wrap({cls: 'x-form-check-wrap'});
-
+
this.currCls = this.getCls(this.value);
this.wrap.addClass(this.currCls);
if(this.clickClass && !this.disabled && !this.readOnly)
this.innerWrap.addClassOnClick(this.clickClass);
if(this.overClass && !this.disabled && !this.readOnly)
this.innerWrap.addClassOnOver(this.overClass);
-
+
this.imageEl = this.innerWrap.createChild({
tag: 'img',
src: Ext.BLANK_IMAGE_URL,
cls: 'x-form-tscheckbox'
}, this.el);
if(this.fieldClass) this.imageEl.addClass(this.fieldClass);
-
+
if(this.boxLabel){
this.innerWrap.createChild({
- tag: 'label',
- htmlFor: this.el.id,
- cls: 'x-form-cb-label',
+ tag: 'label',
+ htmlFor: this.el.id,
+ cls: 'x-form-cb-label',
html: this.boxLabel
});
}
-
+
// Need to repaint for IE, otherwise positioning is broken
if(Ext.isIE){
this.wrap.repaint();
}
this.resizeEl = this.positionEl = this.wrap;
@@ -958,21 +958,21 @@
if(this.handler) this.handler.call(this.scope || this, this, this.value);
}
return this;
},
normalizeValue: function(v) {
- return (v === null || v === undefined) && this.triState ? null :
+ return (v === null || v === undefined) && this.triState ? null :
(v === true || (['true', 'yes', 'on', '1']).indexOf(String(v).toLowerCase()) != -1);
},
getCls: function(v) {
var idx = this.vList.indexOf(this.value);
return idx > -1 ? this.cList[idx] : undefined;
},
updateView: function() {
var cls = this.getCls(this.value);
if (!this.wrap || cls === undefined) return;
-
+
this.wrap.replaceClass(this.currCls, cls);
this.currCls = cls;
}
});
-Ext.reg('tricheckbox', Ext.ux.form.TriCheckbox);
+Ext.reg('tricheckbox', Ext.ux.form.TriCheckbox);
\ No newline at end of file