Only two level
Opened this issue · 4 comments
electrixx90 commented
rnpowerconsulting commented
I wanted to prevent putting the css inline, which is why I did it this way to start with.
What would make sense is to generate the css classes dynamically.
mherrarte commented
I'm not good enough with CSS, please help me with this awesome plugin, i need only 3 levels
Stereotip42 commented
+1. How fix it?
Stereotip42 commented
As a temporary solution. Just that it will be possible then to integrate into the library.
$(document).ready(function() {
var tables = $('.tabelizer-table');
tables.tabelize({
fullRowClickable: false
});
tables.each(function(index, table) {
var elements = $(table).find('tr');
elements.each(function(index, element) {
var tr = $(this);
var trLevel = $(this).attr('data-level');
var nextTr = $(elements[index + 1]);
var nextTrLevel = nextTr.attr('data-level');
if (index !== elements.length - 1) {
if ($.isNumeric(trLevel) && $.isNumeric(nextTrLevel)) {
if (nextTrLevel <= trLevel) {
tr.find('.expander')
.first()
.off()
.css('opacity', 0);
}
}
} else {
if (trLevel == 1) {
tr.find('.expander')
.first()
.off()
.css('opacity', 0);
}
}
});
});
});