}
Roo.log('button on click ');
- if(this.preventDefault){
+ if(this.href === '' || this.preventDefault){
e.preventDefault();
}
getAutoCreate : function()
{
- var im = {
- tag: 'input',
- type : 'file',
- cls : 'd-none roo-card-upload-selector'
-
- };
- if (this.multiple) {
- im.multiple = 'multiple';
- }
+
return {
cls :'div' ,
cn : [
- Roo.bootstrap.Button.prototype.getAutoCreate.call(this),
- im
-
+ Roo.bootstrap.Button.prototype.getAutoCreate.call(this)
]
};
(window.URL && URL.revokeObjectURL && URL) ||
(window.webkitURL && webkitURL);
-
-
-
- this.selectorEl = this.el.select('.roo-card-upload-selector', true).first();
+ var im = {
+ tag: 'input',
+ type : 'file',
+ cls : 'd-none roo-card-upload-selector'
+
+ };
+ if (this.multiple) {
+ im.multiple = 'multiple';
+ }
+ this.selectorEl = Roo.get(document.body).createChild(im); // so it does not capture click event for navitem.
+
+ //this.selectorEl = this.el.select('.roo-card-upload-selector', true).first();
this.selectorEl.on('change', this.onFileSelected, this);
* @class Roo.bootstrap.menu.Menu
* @extends Roo.bootstrap.Component
* @licence LGPL
- * @children Roo.bootstrap.menu.Item
+ * @children Roo.bootstrap.menu.Item Roo.bootstrap.menu.Separator
* @parent none
* Bootstrap Menu class - container for MenuItems - normally has to be added to a object that supports the menu property
*
* @cfg {bool} hidden if the menu should be hidden when rendered.
* @cfg {bool} stopEvent (true|false) Stop event after trigger press (default true)
* @cfg {bool} isLink (true|false) the menu has link disable auto expand and collaspe (default false)
- * @cfg {bool} hideTrigger (true|false) default false - hide the carret for trigger.
- * @cfg {String} align default tl-bl? == below - how the menu should be aligned.
+* @cfg {bool} hideTrigger (true|false) default false - hide the carret for trigger.
+* @cfg {String} align default tl-bl? == below - how the menu should be aligned.
* @constructor
* Create a new Menu
},
onClick : function(e)
{
- Roo.log('item on click ');
+ //Roo.log('item on click ');
- if(this.preventDefault){
+ if(this.href === false || this.preventDefault){
e.preventDefault();
}
//this.parent().hideMenuItems();
delete this.items;
for(var i =0;i < items.length;i++) {
+ // we force children not to montor widnow resize - as we do that for them.
+ items[i].monitorWindowResize = false;
nitems.push(this.addxtype(Roo.apply({}, items[i])));
}
}
}
this.resizeTo(w,h);
+ // any layout/border etc.. resize..
+ (function () {
+ this.items.forEach( function(e) {
+ e.layout ? e.layout() : false;
+
+ });
+ }).defer(100,this);
+
},
show : function() {
// set zindex here - otherwise it appears to be ignored...
this.el.setStyle('z-index', Roo.bootstrap.Modal.zIndex++);
-
+
+
+ // this is for children that are... layout.Border
(function () {
this.items.forEach( function(e) {
e.layout ? e.layout() : false;
}
if(
- this.preventDefault ||
- this.href == '#'
+ this.preventDefault ||
+ this.href === false ||
+ this.href === '#'
){
- Roo.log("NavItem - prevent Default?");
+ //Roo.log("NavItem - prevent Default?");
e.preventDefault();
}
*
* @cfg {String} cls table class
*
- *
+ *
+ * @cfg {string} empty_results Text to display for no results
* @cfg {boolean} striped Should the rows be alternative striped
* @cfg {boolean} bordered Add borders to the table
* @cfg {boolean} hover Add hover highlighting
* @cfg {Boolean} headerShow (true|false) generate thead, default true
* @cfg {Boolean} rowSelection (true|false) default false
* @cfg {Boolean} cellSelection (true|false) default false
- * @cfg {Boolean} scrollBody (true|false) default false - body scrolled / fixed header
+ * @cfg {Boolean} scrollBody (true|false) default false - body scrolled / fixed header (with resizable columns)
* @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)
- * @cfg {Boolean} enableColumnResize default true if columns can be resized (drag/drop)
+ * @cfg {Boolean} enableColumnResize default true if columns can be resized = needs scrollBody to be set to work (drag/drop)
+ *
+ *
* @cfg {Number} minColumnWidth default 50 pixels minimum column width
*
* @constructor
cls: false,
+ empty_results : '',
striped : false,
scrollBody : false,
bordered: false,
}
styles.push('#' , this.id , ' .x-hcol-' , i, " { ", width, hidden," }\n",
- '#' , this.id , ' .x-grid-split-' , i, " { ", left, splithide,'height:', (headHeight - 4), "px;}\n"
+ '#' , this.id , ' .x-grid-split-' , i, " { ", left, splithide, 'height:', (headHeight - 4), "px;}\n",
+ // this is the popover version..
+ '.popover-inner #' , this.id , ' .x-grid-split-' , i, " { ", left, splithide, 'height:', 100, "%;}\n"
);
}
}
}, this);
+ } else if (this.empty_results.length) {
+ this.el.mask(this.empty_results, 'no-spinner');
}
var tfoot = this.el.select('tfoot', true).first();
onBeforeLoad : function()
{
-
+ this.el.unmask(); // if needed.
},
/**
* Remove all rows
try {
result = o.reader.read(response);
}catch(e){
+ o.success = false;
+ o.raw = { errorMsg : response.responseText };
this.fireEvent("loadexception", this, o, response, e);
- o.request.callback.call(o.request.scope, {
- success : false,
- raw : {
- errorMsg : response
- }
-
- }, o.request.arg, false);
+ o.request.callback.call(o.request.scope, o, o.request.arg, false);
return;
}
}
var records = [];
for(var i = 0; i < c; i++){
- var n = root[i];
+ var n = root[i];
var values = {};
var id = this.getId(n);
for(var j = 0; j < fl; j++){
f = fi[j];
- var v = this.ef[j](n);
- if (!f.convert) {
- Roo.log('missing convert for ' + f.name);
- Roo.log(f);
- continue;
- }
- values[f.name] = f.convert((v !== undefined) ? v : f.defaultValue);
- }
+ var v = this.ef[j](n);
+ if (!f.convert) {
+ Roo.log('missing convert for ' + f.name);
+ Roo.log(f);
+ continue;
+ }
+ values[f.name] = f.convert((v !== undefined) ? v : f.defaultValue);
+ }
+ if (!Record) {
+ return {
+ raw : { errorMsg : "JSON Reader Error: fields or metadata not available to create Record" },
+ success : false,
+ records : [],
+ totalRecords : 0
+ };
+ }
var record = new Record(values, id);
record.json = n;
records[i] = record;
},
// private
- onLoadError : function(){
+ onLoadError : function(proxy, o){
this.loading.enable();
+ if (this.ds.events.loadexception.listeners.length < 2) {
+ // nothing has been assigned to loadexception except this...
+ // so
+ Roo.MessageBox.alert("Error loading",o.raw.errorMsg);
+
+ }
},
// private
*/
Roo.bootstrap.layout.Manager = function(config)
{
+ this.monitorWindowResize = true; // do this before we apply configuration.
+
Roo.bootstrap.layout.Manager.superclass.constructor.call(this,config);
/** false to disable window resize monitoring @type Boolean */
- this.monitorWindowResize = true;
+
this.regions = {};
this.addEvents({
/**
ignoreResize : function(w, h)
{
- return false; // always resize?
+ //return false; // always resize?
if(this.lastSize && this.lastSize.width == w && this.lastSize.height == h){
return true;
}else{
Roo.extend(Roo.bootstrap.panel.Grid, Roo.bootstrap.panel.Content,
{
- // private
- is_resizing : false,
-
+
getId : function(){
return this.grid.id;
},
setSize : function(width, height)
{
- if (this.is_resizing) {
- return;
-
- }
- this.is_resizing = true;
- if(!this.ignoreResize(width, height)){
+
+ //if(!this.ignoreResize(width, height)){
var grid = this.grid;
var size = this.adjustForComponents(width, height);
// tfoot is not a footer?
//}
grid.autoSize();
- }
- this.is_resizing = false;
+ //}
+
},