/**
* @event expand
* Fires when the dropdown list is expanded
- * @param {Roo.bootstrap.ComboBox} combo This combo box
- */
+ * @param {Roo.bootstrap.ComboBox} combo This combo box
+ */
'expand' : true,
/**
* @event collapse
* Fires when the dropdown list is collapsed
- * @param {Roo.bootstrap.ComboBox} combo This combo box
- */
+ * @param {Roo.bootstrap.ComboBox} combo This combo box
+ */
'collapse' : true,
/**
* @event beforeselect
* Fires before a list item is selected. Return false to cancel the selection.
- * @param {Roo.bootstrap.ComboBox} combo This combo box
- * @param {Roo.data.Record} record The data record returned from the underlying store
- * @param {Number} index The index of the selected item in the dropdown list
- */
+ * @param {Roo.bootstrap.ComboBox} combo This combo box
+ * @param {Roo.data.Record} record The data record returned from the underlying store
+ * @param {Number} index The index of the selected item in the dropdown list
+ */
'beforeselect' : true,
/**
* @event select
* Fires when a list item is selected
- * @param {Roo.bootstrap.ComboBox} combo This combo box
- * @param {Roo.data.Record} record The data record returned from the underlying store (or false on clear)
- * @param {Number} index The index of the selected item in the dropdown list
- */
+ * @param {Roo.bootstrap.ComboBox} combo This combo box
+ * @param {Roo.data.Record} record The data record returned from the underlying store (or false on clear)
+ * @param {Number} index The index of the selected item in the dropdown list
+ */
'select' : true,
/**
* @event beforequery
* Fires before all queries are processed. Return false to cancel the query or set cancel to true.
* The event object passed has these properties:
- * @param {Roo.bootstrap.ComboBox} combo This combo box
- * @param {String} query The query
- * @param {Boolean} forceAll true to force "all" query
- * @param {Boolean} cancel true to cancel the query
- * @param {Object} e The query event object
- */
+ * @param {Roo.bootstrap.ComboBox} combo This combo box
+ * @param {String} query The query
+ * @param {Boolean} forceAll true to force "all" query
+ * @param {Boolean} cancel true to cancel the query
+ * @param {Object} e The query event object
+ */
'beforequery': true,
/**
* @event add
* Fires when the 'add' icon is pressed (add a listener to enable add button)
- * @param {Roo.bootstrap.ComboBox} combo This combo box
- */
+ * @param {Roo.bootstrap.ComboBox} combo This combo box
+ */
'add' : true,
/**
* @event edit
* Fires when the 'edit' icon is pressed (add a listener to enable add button)
- * @param {Roo.bootstrap.ComboBox} combo This combo box
- * @param {Roo.data.Record|false} record The data record returned from the underlying store (or false on nothing selected)
- */
+ * @param {Roo.bootstrap.ComboBox} combo This combo box
+ * @param {Roo.data.Record|false} record The data record returned from the underlying store (or false on nothing selected)
+ */
'edit' : true,
/**
* @event remove
* Fires when the remove value from the combobox array
- * @param {Roo.bootstrap.ComboBox} combo This combo box
- */
+ * @param {Roo.bootstrap.ComboBox} combo This combo box
+ */
'remove' : true,
/**
* @event afterremove
* Fires when the remove value from the combobox array
- * @param {Roo.bootstrap.ComboBox} combo This combo box
- */
+ * @param {Roo.bootstrap.ComboBox} combo This combo box
+ */
'afterremove' : true,
/**
* @event specialfilter
throw "can not find store for combo";
}
- Roo.log('------------store--------------');
- Roo.log(this.store);
+ this.indicator = this.indicatorEl();
- this.store = Roo.factory(this.store, Roo.data);z
+ this.store = Roo.factory(this.store, Roo.data);
this.store.parent = this;
// if we are building from html. then this element is so complex, that we can not really
// use the rendered HTML.
// so we have to trash and replace the previous code.
if (Roo.XComponent.build_from_html) {
-
// remove this element....
var e = this.el.dom, k=0;
while (e ) { e = e.previousSibling; ++k;}
this.rendered = false;
this.render(this.parent().getChildContainer(true), k);
-
-
-
}
if(Roo.isIOS && this.useNativeIOS){
this.list.on('mouseover', this.onViewOver, this);
this.list.on('mousemove', this.onViewMove, this);
-
this.list.on('scroll', this.onViewScroll, this);
/*
this.list.on('scroll', this.onViewScroll, this);
if(!this.tpl){
- this.tpl = '<li class="roo-select2-result"><div class="checkbox"><input id="{roo-id}" type="checkbox" {roo-data-checked}><label for="{roo-id}"><b>{' + this.displayField + '}</b></label></div></li>';
+ this.tpl = '<li class="roo-select2-result"><div class="checkbox"><input id="{roo-id}"' +
+ 'type="checkbox" {roo-data-checked}><label for="{roo-id}"><b>{' + this.displayField + '}</b></label></div></li>';
}
this.view = new Roo.View(this.list, this.tpl, {
- singleSelect:true, tickable:true, parent:this, store: this.store, selectedClass: this.selectedClass
+ singleSelect:true,
+ tickable:true,
+ parent:this,
+ store: this.store,
+ selectedClass: this.selectedClass
});
//this.view.wrapEl.setDisplayed(false);
var close = this.closeTriggerEl();
if(close){
- (vv.length || vv * 1 > 0) ? close.show() : close.hide();
+ if(dv.length || vv * 1 > 0){
+ close.show() ;
+ this.blockFocus=true;
+ } else {
+ close.hide();
+ }
}
if(this.hiddenField){
onEmptyResults : function(){
if(this.tickable && this.editable){
+ this.hasFocus = false;
this.restrictHeight();
return;
}
validate : function()
{
+ if(this.getVisibilityEl().hasClass('hidden')){
+ return true;
+ }
+
var v = this.getRawValue();
if(this.multiple){
cfg.cn = [
{
tag: 'label',
+ 'for' : id,
cls : 'control-label',
- html : this.fieldLabel,
cn : [
{
- tag : 'i',
- cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
- tooltip : 'This field is required'
+ tag : 'span',
+ html : this.fieldLabel
+ },
+ {
+ tag : 'i',
+ cls : 'roo-required-indicator right-indicator text-danger fa fa-lg fa-star',
+ tooltip : 'This field is required'
}
]
},
{
- cls : '',
+ cls : "",
cn: [
combobox
]
}
+
];
+
+ labelCfg = cfg.cn[0];
+ contentCfg = cfg.cn[1];
}
- labelCfg = cfg.cn[0];
- contentCfg = cfg.cn[2];
+
if(this.labelWidth > 12){
labelCfg.style = "width: " + this.labelWidth + 'px';
document.activeElement.blur();
}, this);
+ this._touchViewMask = Roo.DomHelper.append(document.body, {tag: "div", cls:"x-dlg-mask"}, true);
+
return;
this.touchViewEl.setStyle('z-index', Roo.bootstrap.Modal.zIndex++);
this.touchViewEl.show();
- this.touchViewEl.select('.modal-dialog', true).first().setStyle('margin', '0px');
- this.touchViewEl.select('.modal-dialog > .modal-content', true).first().setSize(
- Roo.lib.Dom.getViewWidth(true), Roo.lib.Dom.getViewHeight(true));
+ this.touchViewEl.select('.modal-dialog', true).first().setStyle({ margin : '0px', width : '100%'});
+
+ //this.touchViewEl.select('.modal-dialog > .modal-content', true).first().setSize(
+ // Roo.lib.Dom.getViewWidth(true), Roo.lib.Dom.getViewHeight(true));
var bodyHeight = Roo.lib.Dom.getViewHeight() - this.touchViewFooterEl.getHeight() + this.touchViewBodyEl.getPadding('tb');
}else{
this.touchViewEl.addClass('in');
}
+
+ if(this._touchViewMask){
+ this._touchViewMask.setSize(Roo.lib.Dom.getViewWidth(true), Roo.lib.Dom.getViewHeight(true));
+ this._touchViewMask.setStyle('z-index', Roo.bootstrap.Modal.zIndex++);
+ this._touchViewMask.addClass('show');
+ }
+
this.doTouchViewQuery();
var default_text = '-- SELECT --';
+ if(this.placeholder.length){
+ default_text = this.placeholder;
+ }
+
+ if(this.emptyTitle.length){
+ default_text += ' - ' + this.emptyTitle + ' -';
+ }
+
var opt = this.inputEl().createChild({
tag: 'option',
value : 0,