Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only two level #9

Open
electrixx90 opened this issue Apr 17, 2014 · 4 comments
Open

Only two level #9

electrixx90 opened this issue Apr 17, 2014 · 4 comments

Comments

@electrixx90
Copy link

cattura
How can I do this correctly? Without left expander and without the possibility to expand itself.
I need only two level and the plugin seems to work with only 4 levels.

Thanks a lot.

@rnpowerconsulting
Copy link
Contributor

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
Copy link

I'm not good enough with CSS, please help me with this awesome plugin, i need only 3 levels

@Stereotip42
Copy link

+1. How fix it?

@Stereotip42
Copy link

Stereotip42 commented Nov 23, 2016

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);
                }
            }
        });
    });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants