9 * @class Roo.bootstrap.NavProgressItem
10 * @extends Roo.bootstrap.Component
11 * Bootstrap NavProgressItem class
12 * @cfg {String} rid the reference id
13 * @cfg {Boolean} active (true|false) Is item active default false
14 * @cfg {Boolean} disabled (true|false) Is item active default false
16 * @cfg {String} position (top|bottom) text position default bottom
17 * @cfg {String} icon show icon instead of number
18 * @cfg {Boolean} forceIcon (true|false) true to force show icon..if set to false, Roo.isTouch showing icon, otherwish number
21 * Create a new NavProgressItem
22 * @param {Object} config The config object
24 Roo.bootstrap.NavProgressItem = function(config){
25 Roo.bootstrap.NavProgressItem.superclass.constructor.call(this, config);
30 * The raw click event for the entire grid.
31 * @param {Roo.bootstrap.NavProgressItem} this
32 * @param {Roo.EventObject} e
39 Roo.extend(Roo.bootstrap.NavProgressItem, Roo.bootstrap.Component, {
49 getAutoCreate : function()
51 var iconCls = 'roo-navigation-bar-item-icon';
53 if((this.forceIcon && this.icon) || !this.forceIcon && Roo.isTouch){
54 iconCls += ' ' + this.icon;
59 cls: 'roo-navigation-bar-item',
67 cls : 'roo-navigation-bar-item-text ' + this.position,
77 cfg.cls += ' disabled';
83 render : function(container, position){
84 if(!this.rendered && this.fireEvent("beforerender", this) !== false){
86 this.onRender(container, position || null);
91 initEvents: function()
93 this.iconEl = this.el.select('.roo-navigation-bar-item-icon', true).first();
94 this.textEl = this.el.select('.roo-navigation-bar-item-text', true).first();
97 this.textEl.setVisibilityMode(Roo.Element.DISPLAY).hide();
100 this.iconEl.on('click', this.onClick, this);
104 onClick : function(e)
112 if(this.fireEvent('click', this, e) === false){
116 this.parent().setActiveItem(this);
119 isActive: function ()
124 setActive : function(state)
126 if(this.active == state){
133 this.el.addClass('active');
137 this.el.removeClass('active');
142 setDisabled : function(state)
144 if(this.disabled == state){
148 this.disabled = state;
151 this.el.addClass('disabled');
155 this.el.removeClass('disabled');
158 tooltipEl : function()
160 return this.el.select('.roo-navigation-bar-item-icon', true).first();;