this.getVisibilityEl().removeClass('hidden');
+ this.fireEvent('show', this);
+
},
/**
this.getVisibilityEl().addClass('hidden');
+ this.fireEvent('hide', this);
+
}
});
* @cfg {Boolean} allow_close default true
* @cfg {Boolean} fitwindow default false
* @cfg {String} size (sm|lg) default empty
+ * @cfg {Number} max_width set the max width of modal
*
*
* @constructor
closeEl: false,
size: '',
+
+ max_width: 0,
onRender : function(ct, position)
},
- getAutoCreate : function(){
-
-
+ getAutoCreate : function()
+ {
var bdy = {
cls : 'modal-body',
html : this.html || ''
resize : function()
{
this.maskEl.setSize(Roo.lib.Dom.getViewWidth(true), Roo.lib.Dom.getViewHeight(true));
+
if (this.fitwindow) {
var w = this.width || Roo.lib.Dom.getViewportWidth(true) - 30;
var h = this.height || Roo.lib.Dom.getViewportHeight(true) - 60;
this.setSize(w,h);
}
+
+ if(!this.fitwindow && this.max_width !== 0){
+
+ var w = Math.min(this.max_width, Roo.lib.Dom.getViewportWidth(true) - 30);
+
+ Roo.log(this.height);
+
+ if(this.height) {
+ this.setSize(w, this.height);
+ return;
+ }
+
+ var view_height = Roo.lib.Dom.getViewportHeight(true) - 60;
+
+ var body_childs = this.bodyEl.dom.childNodes;
+ var body_height = 0;
+ for(var i = 0; i < body_childs.length; i++) {
+ body_height += body_childs[i].offsetHeight;
+ }
+
+ // this.setSize(w, this.height || view_height);
+
+
+
+ //
+ // if(
+ // (
+ // this.headerEl.getHeight() +
+ // this.bodyEl.getHeight() +
+ // this.footerEl.getHeight()
+ // ) > view_height) {
+ // } {
+ // this.setSize(w,view_height);
+ // }
+ }
+
},
setSize : function(w,h)
}).defer(50, this);
}else{
this.el.addClass('in');
-
}
// not sure how we can show data in here..
/**
* @cfg {String} align (Optional) Set the CSS text-align property of the column. Defaults to undefined.
*/
+ /**
+ * @cfg {String} valign (Optional) Set the CSS vertical-align property of the column (eg. middle, top, bottom etc). Defaults to undefined.
+ */
/**
* @cfg {String} cursor (Optional)
*/
* @cfg {Boolean} scrollBody (true|false) default false - body scrolled / fixed header
* @cfg {Roo.bootstrap.PagingToolbar} footer a paging toolbar
* @cfg {Boolean} lazyLoad auto load data while scrolling to the end (default false)
+ * @cfg {Boolean} auto_hide_footer auto hide footer if only one page (default false)
*
* @constructor
CSS : Roo.util.CSS,
+ auto_hide_footer : false,
+
getAutoCreate : function()
{
var cfg = Roo.apply({}, Roo.bootstrap.Table.superclass.getAutoCreate.call(this));
}
// this lot should be simplifed...
+ var _t = this;
+ var cp = [
+ 'align',
+ 'bgcolor',
+ 'border',
+ 'cellpadding',
+ 'cellspacing',
+ 'frame',
+ 'rules',
+ 'sortable',
+ 'summary',
+ 'width'
+ ].forEach(function(k) {
+ if (_t[k]) {
+ cfg[k] = _t[k];
+ }
+ });
+
- if (this.align) {
- cfg.align=this.align;
- }
- if (this.bgcolor) {
- cfg.bgcolor=this.bgcolor;
- }
- if (this.border) {
- cfg.border=this.border;
- }
- if (this.cellpadding) {
- cfg.cellpadding=this.cellpadding;
- }
- if (this.cellspacing) {
- cfg.cellspacing=this.cellspacing;
- }
- if (this.frame) {
- cfg.frame=this.frame;
- }
- if (this.rules) {
- cfg.rules=this.rules;
- }
- if (this.sortable) {
- cfg.sortable=this.sortable;
- }
- if (this.summary) {
- cfg.summary=this.summary;
- }
- if (this.width) {
- cfg.width=this.width;
- }
if (this.layout) {
cfg.style = (typeof(cfg.style) == 'undefined') ? ('table-layout:' + this.layout + ';') : (cfg.style + ('table-layout:' + this.layout + ';'));
}
this.mainBody = this.el.select('tbody', true).first();
this.mainHead = this.el.select('thead', true).first();
-
+ this.mainFoot = this.el.select('tfoot', true).first();
}, this);
}
+ var tfoot = this.el.select('tfoot', true).first();
+
+ if(this.footerShow && this.auto_hide_footer && this.mainFoot){
+
+ this.mainFoot.setVisibilityMode(Roo.Element.DISPLAY).hide();
+
+ var total = this.ds.getTotalCount();
+
+ if(this.footer.pageSize < total){
+ this.mainFoot.show();
+ }
+ }
+
Roo.each(this.el.select('tbody td', true).elements, function(e){
e.on('mouseover', _this.onMouseover, _this);
});
if(typeof(config.align) != 'undefined' && config.align.length){
td.style += ' text-align:' + config.align + ';';
}
+ if(typeof(config.valign) != 'undefined' && config.valign.length){
+ td.style += ' vertical-align:' + config.valign + ';';
+ }
if(typeof(config.width) != 'undefined'){
td.style += ' width:' + config.width + 'px;';
if(f.validate()){
return;
}
+
valid = false;
if(!target && f.el.isVisible(true)){
this.indicator = this.indicatorEl();
if(this.indicator){
- this.indicator.addClass('invisible');
+ this.indicator.addClass(this.indicatorpos == 'right' ? 'hidden' : 'invisible'); // changed from invisible??? -
}
// reference to original value for reset
}
+ if(this.indicator){
+ this.indicator.removeClass('visible');
+ this.indicator.addClass(this.indicatorpos == 'right' ? 'hidden' : 'invisible');
+ }
+
this.fireEvent('valid', this);
},
if(this.indicator){
this.indicator.removeClass('visible');
- this.indicator.addClass('invisible');
+ this.indicator.addClass(this.indicatorpos == 'right' ? 'hidden' : 'invisible');
}
if(this.disabled){
}
if(this.indicator){
- this.indicator.removeClass('invisible');
+ this.indicator.removeClass(this.indicatorpos == 'right' ? 'hidden' : 'invisible');
this.indicator.addClass('visible');
}
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);
this.showMode();
if(this.isInline) {
- this.show();
+ this.showPopup();
}
},
onFocus : function()
{
Roo.bootstrap.DateField.superclass.onFocus.call(this);
- this.show();
+ this.showPopup();
},
onBlur : function()
this.setValue(d);
- this.hide();
+ this.hidePopup();
},
- show : function()
+ showPopup : function()
{
this.picker().show();
this.update();
this.place();
- this.fireEvent('show', this, this.date);
+ this.fireEvent('showpopup', this, this.date);
},
- hide : function()
+ hidePopup : function()
{
if(this.isInline) {
return;
this.viewMode = this.startViewMode;
this.showMode();
- this.fireEvent('hide', this, this.date);
+ this.fireEvent('hidepopup', this, this.date);
},
{
if (!this.picker().isVisible()){
if (e.keyCode == 27) { // allow escape to hide and re-show picker
- this.show();
+ this.showPopup();
}
return;
}
switch(e.keyCode){
case 27: // escape
- this.hide();
+ this.hidePopup();
e.preventDefault();
break;
case 37: // left
break;
case 13: // enter
this.setValue(this.formatDate(this.date));
- this.hide();
+ this.hidePopup();
e.preventDefault();
break;
case 9: // tab
this.setValue(this.formatDate(this.date));
- this.hide();
+ this.hidePopup();
break;
case 16: // shift
case 17: // ctrl
// this.fill()
this.setValue(this.formatDate(this.date));
- this.hide();
+ this.hidePopup();
break;
}
break;
if(this.singleMode){
this.setValue(this.formatDate(this.viewDate));
- this.hide();
+ this.hidePopup();
return;
}
// this.fill();
//Roo.log(this.formatDate(this.date));
this.setValue(this.formatDate(this.date));
- this.hide();
+ this.hidePopup();
}
break;
}
return true;
},
- setVisible : function(visible)
+ reset : function()
{
- if(!this.getEl()){
- return;
- }
-
- this.getEl().removeClass('hidden');
-
- if(visible){
- return;
- }
+ this.date = this.viewDate = '';
- this.getEl().addClass('hidden');
+ Roo.bootstrap.DateField.superclass.setValue.call(this, '');
}
});
placement = 'top';
}
+ align = this.alignment[placement];
}
this.el.alignTo(this.bindEl, align[0],align[1]);
* @param {Roo.bootstrap.DocumentManager} this
* @param {Object} file
*/
- "previewrendered" : true
+ "previewrendered" : true,
+ /**
+ */
+ "previewResize" : true
});
};
var width = image.dom.naturalWidth || image.dom.width;
var height = image.dom.naturalHeight || image.dom.height;
+ if(!this.previewResize) {
+ return;
+ }
+
if(width > height){
file.target.addClass('wide');
return;