Explorar el Código

[metastore] Disable DataTable plugin for tables with more than 1000 columns

Enrico Berti hace 10 años
padre
commit
3e30843e56
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      apps/metastore/src/metastore/templates/describe_table.mako

+ 4 - 2
apps/metastore/src/metastore/templates/describe_table.mako

@@ -257,9 +257,9 @@ ${ components.menubar() }
   $(document).ready(function () {
   $(document).ready(function () {
 
 
     function selectColumn(col) {
     function selectColumn(col) {
-      var _t = $("#sample");
+      var _t = $("#sampleTable");
       var _col = _t.find("th").filter(function() {
       var _col = _t.find("th").filter(function() {
-        return $.trim($(this).text()) == col;
+        return $.trim($(this).text()).indexOf(col) > -1;
       });
       });
       _t.find(".columnSelected").removeClass("columnSelected");
       _t.find(".columnSelected").removeClass("columnSelected");
       _t.find("tr td:nth-child(" + (_col.index() + 1) + ")").addClass("columnSelected");
       _t.find("tr td:nth-child(" + (_col.index() + 1) + ")").addClass("columnSelected");
@@ -305,6 +305,7 @@ ${ components.menubar() }
 
 
       for (var id in sortables) {
       for (var id in sortables) {
         $("#" + id).addClass("initialized");
         $("#" + id).addClass("initialized");
+        % if len(table.cols) < 1000:
         $("#" + id).dataTable({
         $("#" + id).dataTable({
           "aoColumns": sortables[id],
           "aoColumns": sortables[id],
           "bPaginate": false,
           "bPaginate": false,
@@ -326,6 +327,7 @@ ${ components.menubar() }
             "sZeroRecords": "${_('No matching records')}"
             "sZeroRecords": "${_('No matching records')}"
           }
           }
         });
         });
+        % endif
       }
       }
       if ($(e.target).attr("href") == "#columnAnalysisTerms") {
       if ($(e.target).attr("href") == "#columnAnalysisTerms") {
         $("#columnAnalysis .filter").removeClass("hide");
         $("#columnAnalysis .filter").removeClass("hide");