2015-05-28 15:44:23 +02:00
|
|
|
|
|
|
|
(function(win, TableFilter){
|
|
|
|
|
|
|
|
var tf = new TableFilter('demo', {
|
|
|
|
base_path: '../dist/tablefilter/',
|
|
|
|
col_widths: ['150px', '100px', '175px', '120px', null]
|
|
|
|
});
|
|
|
|
tf.init();
|
|
|
|
|
|
|
|
module('Sanity checks');
|
|
|
|
test('Column widths', function() {
|
2015-06-06 14:22:13 +02:00
|
|
|
var cols = tf.tbl.getElementsByTagName('col');
|
2015-05-28 15:44:23 +02:00
|
|
|
deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated');
|
2015-06-06 14:22:13 +02:00
|
|
|
deepEqual(cols[1].style.width, '100px', 'Expected column width');
|
|
|
|
deepEqual(cols[4].style.width, '', 'Expected column width');
|
2015-05-28 15:44:23 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
test('Grid layout column widths', function() {
|
|
|
|
tf.destroy();
|
|
|
|
tf = null;
|
|
|
|
tf = new TableFilter('demo', {
|
|
|
|
base_path: '../dist/tablefilter/',
|
|
|
|
col_widths: ['150px', '100px', '175px', '120px', '200px'],
|
|
|
|
grid_layout: true,
|
|
|
|
sort: false
|
|
|
|
});
|
|
|
|
tf.init();
|
2015-06-06 14:22:13 +02:00
|
|
|
var cols = tf.Cpt.gridLayout.headTbl.getElementsByTagName('col');
|
|
|
|
deepEqual(cols[0].style.width, '150px', 'Expected column width');
|
|
|
|
deepEqual(cols[4].style.width, '200px', 'Expected column width');
|
2015-05-28 15:44:23 +02:00
|
|
|
});
|
|
|
|
|
2015-06-06 14:22:13 +02:00
|
|
|
})(window, TableFilter);
|