Roo.bootstrap.PaginationItem = function(config){
Roo.bootstrap.PaginationItem.superclass.constructor.call(this, config);
this.addEvents({
"click" : true
});
};
Roo.extend(Roo.bootstrap.PaginationItem, Roo.bootstrap.Component, {
href : false,
html : false,
preventDefault: true,
active : false,
cls : false,
disabled: false,
getAutoCreate : function(){
var cfg= {
tag: 'li',
cn: [
{
tag : 'a',
href : this.href ? this.href : '#',
html : this.html ? this.html : ''
}
]
};
if(this.cls){
cfg.cls = this.cls;
}
if(this.disabled){
cfg.cls = typeof(cfg.cls) !== 'undefined' ? cfg.cls + ' disabled' : 'disabled';
}
if(this.active){
cfg.cls = typeof(cfg.cls) !== 'undefined' ? cfg.cls + ' active' : 'active';
}
return cfg;
},
initEvents: function() {
this.el.on('click', this.onClick, this);
},
onClick : function(e)
{
Roo.log('PaginationItem on click ');
if(this.preventDefault){
e.preventDefault();
}
if(this.disabled){
return;
}
this.fireEvent('click', this, e);
}
});