Minor refactoring
Updated minified version Created a new public method for adding alt rows css class namesmaster
parent
b9bea2a883
commit
c30fe94be0
|
@ -25,18 +25,19 @@
|
||||||
// plugin's default options
|
// plugin's default options
|
||||||
var defaults = {
|
var defaults = {
|
||||||
|
|
||||||
width: '100%',
|
width: '100%',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
borderCollapse: true,
|
themeClass: 'fht-default',
|
||||||
themeClass: 'fht-default',
|
|
||||||
|
|
||||||
fixedColumn: false, // fixed first column
|
borderCollapse: true,
|
||||||
autoShow: true, // hide table after its created
|
fixedColumn: false, // fixed first column
|
||||||
loader: false,
|
sortable: false,
|
||||||
footer: false, // show footer
|
autoShow: true, // hide table after its created
|
||||||
cloneHeadToFoot: false, // clone head and use as footer
|
footer: false, // show footer
|
||||||
autoResize: false, // resize table if its parent wrapper changes size
|
cloneHeadToFoot: false, // clone head and use as footer
|
||||||
create: null // callback after plugin completes
|
autoResize: false, // resize table if its parent wrapper changes size
|
||||||
|
|
||||||
|
create: null // callback after plugin completes
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,8 +173,7 @@
|
||||||
$self.addClass('fht-table-init');
|
$self.addClass('fht-table-init');
|
||||||
|
|
||||||
if ( typeof(settings.altClass) !== 'undefined' ) {
|
if ( typeof(settings.altClass) !== 'undefined' ) {
|
||||||
$self.find('tbody tr:odd')
|
methods.altRows.apply( self );
|
||||||
.addClass(settings.altClass);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( settings.fixedColumn == true ) {
|
if ( settings.fixedColumn == true ) {
|
||||||
|
@ -200,6 +200,19 @@
|
||||||
return self;
|
return self;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add CSS class to alternating rows
|
||||||
|
*/
|
||||||
|
altRows: function( arg1 ) {
|
||||||
|
var $self = $(this),
|
||||||
|
self = this,
|
||||||
|
altClass = ( typeof(arg1) !== 'undefined' ) ? arg1 : settings.altClass;
|
||||||
|
|
||||||
|
$self.closest('.fht-table-wrapper')
|
||||||
|
.find('tbody tr:odd:not(:hidden)')
|
||||||
|
.addClass(altClass);
|
||||||
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Show a hidden fixedHeaderTable table
|
* Show a hidden fixedHeaderTable table
|
||||||
*/
|
*/
|
||||||
|
@ -367,9 +380,15 @@
|
||||||
* return void
|
* return void
|
||||||
*/
|
*/
|
||||||
_fixWidthWithCss: function( $obj, tableProps ) {
|
_fixWidthWithCss: function( $obj, tableProps ) {
|
||||||
$obj.css({
|
if ( settings.includePadding ) {
|
||||||
'width': $obj.width() + tableProps.border
|
$obj.css({
|
||||||
});
|
'width': $obj.width() + tableProps.border
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$obj.css({
|
||||||
|
'width': $obj.parent().width() + tableProps.border
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -440,7 +459,7 @@
|
||||||
.find('tr')
|
.find('tr')
|
||||||
.append($firstTdFootChild.clone());
|
.append($firstTdFootChild.clone());
|
||||||
$tfoot.css({
|
$tfoot.css({
|
||||||
'top': settings.scrollbarOffset + tableProps.border
|
'top': settings.scrollbarOffset
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue