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';
85 this.setDisabled(true);
88 initEvents: function()
90 this.iconEl = this.el.select('.roo-navigation-bar-item-icon', true).first();
91 this.textEl = this.el.select('.roo-navigation-bar-item-text', true).first();
94 this.textEl.setVisibilityMode(Roo.Element.DISPLAY).hide();
97 this.iconEl.on('click', this.onClick, this);
101 onClick : function(e)
109 if(this.fireEvent('click', this, e) === false){
113 this.parent().setActiveItem(this);
116 isActive: function ()
121 setActive : function(state)
123 if(this.active == state){
130 this.el.addClass('active');
134 this.el.removeClass('active');
139 setDisabled : function(state)
141 if(this.disabled == state){
145 this.disabled = state;
148 this.el.addClass('disabled');
152 this.el.removeClass('disabled');
155 tooltipEl : function()
157 return this.el.select('.roo-navigation-bar-item-icon', true).first();;