* @param {Roo.bootstrap.ComboBox} combo This combo box
* @param {Object} cfg set html .
*/
- 'touchviewdisplay' : true
-
+ 'touchviewdisplay' : true,
+ /**
+ * @event ontouchviewload
+ * Fires when touch view load (local store)
+ * @param {Roo.bootstrap.ComboBox} combo This combo box
+ */
+ 'ontouchviewload' : true
});
this.item = [];
throw "can not find store for combo";
}
+ this.indicator = this.indicatorEl();
+
this.store = Roo.factory(this.store, Roo.data);
this.store.parent = 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);
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];
}
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');
(function() { firstChecked.findParent('li').scrollIntoView(_this.touchViewListGroup.dom); }).defer(500);
}
+ this.fireEvent('ontouchviewload', this);
+
},
onTouchViewLoadException : function()
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,