#39 Update search to match all rows
Merged 4 years ago by arrfab. Opened 4 years ago by areguera.
centos/ areguera/centos.org master  into  master

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- function myFunction(){for(var e=document.getElementById("myInput").value.toUpperCase(),t=document.getElementById("myTable").tBodies[0].getElementsByTagName("tr"),n=1;n<t.length;n++){var a=t[n].getElementsByTagName("td");t[n].style.display="none";for(var l=0;l<a.length;l++)a[l].innerHTML.toUpperCase().indexOf(e)>-1&&(t[n].style.display="")}} 

\ No newline at end of file

+ function myFunction(){for(var e=document.getElementById("myInput").value.toUpperCase(),t=document.getElementById("myTable").tBodies[0].getElementsByTagName("tr"),n=0;n<t.length;n++){var a=t[n].getElementsByTagName("td");t[n].style.display="none";for(var l=0;l<a.length;l++)a[l].innerHTML.toUpperCase().indexOf(e)>-1&&(t[n].style.display="")}} 

\ No newline at end of file

  • Previously, the index of matching rows was set to be greater that one,
    as consequence the first row was always displayed no matter what the
    search pattern was. This update corrects the index initial value so
    all rows be considered in the search.

Pull-Request has been merged by arrfab

4 years ago
Metadata