public static String js(){
        return "<script type=\"text/javascript\">\n" +
                "\n" +
                "    $(document).ready(function() {\n" +
                "    $('table')\n" +
                "    .bind('filterEnd', function () {\n" +
                "    var f = $.tablesorter.getFilters( $(this) );\n" +
                "    var empty=true\n" +
                "    for (var i = 0; i < f.length; i++) {\n" +
                "    if(f[i] != \"\"){\n" +
                "    empty=false;\n" +
                "    }\n" +
                "    }\n" +
                "    if(empty){\n" +
                "    console.log(\"empty\");\n" +
                "    $(\"[data-level]\").hide();\n" +
                "    $(\"[data-level='0']\").show();\n" +
                "    }\n" +
                "    else{\n" +
                "    console.log(\"not empty\");\n" +
                "    $(\"[data-level='1']\").hide();\n" +
                "    $(\"[data-level='2']\").hide();\n" +
                "    }\n" +
                "    });\n" +
                "\n" +
                "\n" +
                "    $(\"table\").tablesorter({\n" +
                "    cssChildRow: 'nosort',\n" +
                "    widgets: [\"zebra\", \"filter\"],\n" +
                "    widgetOptions : {\n" +
                "    // include child row content while filtering, if true\n" +
                "    filter_childRows  : false,\n" +
                "    // search from beginning\n" +
                "    filter_startsWith : true,\n" +
                "    filter_columnFilters : true,\n" +
                "    }\n" +
                "    });\n" +
                "\n" +
                "    function getChildren($row) {\n" +
                "    var children = [], level = $row.attr('data-level');\n" +
                "    while($row.next().attr('data-level') > level) {\n" +
                "\n" +
                "    if($row.next().attr('data-level') == parseInt(level)+1){\n" +
                "    children.push($row.next());\n" +
                "    }\n" +
                "    $row = $row.next();\n" +
                "    }\n" +
                "    return children;\n" +
                "    }\n" +
                "\n" +
                "    $('.parent').on('click', function() {\n" +
                "\n" +
                "    var children = getChildren($(this));\n" +
                "    $.each(children, function() {\n" +
                "    if($(this).is(\":visible\")){\n" +
                "    var subchilds=getChildren($(this))\n" +
                "    $.each(subchilds, function() {\n" +
                "    $(this).hide()\n" +
                "    })\n" +
                "    }\n" +
                "    $(this).toggle();\n" +
                "    })\n" +
                "    });\n" +
                "    $(\"[data-level]\").hide();\n" +
                "    $(\"[data-level='0']\").show();\n" +
                "    })\n" +
                "</script>";
    }