• Search feature in v2.1.7

    By Chris Vestre 2 decades ago

    Version 2.1.7



    Though the search agent returns valid results, extra records are displayed in the view. Tried the search on both flat and categorized views.



    Thanks!

    • Possible solution(?) RE: Search feature in v2.1.7

      By Jason Pinske 2 decades ago

      I had the same issue when searching a flat view; The search results (when returned results were less than the number of lines displayed) would replace the lines in the existing data and not clear the rest of the view. i.e. if I am showing 15 lines in the view and the search results returned 5 documents, the first five lines of the original view would be replaced with the search results and the other 10 lines would still be document 6-15 of the original documents displayed in the view.



      I made the following changes to the jsNotesView2.1.7.js library and now get the proper display (in the flat view I'm using)…



      Hope this helps with the final resolution!



      ====================================



      –> in the reset() function I changed the "if(this.view.searchQuery){" statement to:

              if(this.view.searchQuery){<br/>
                  document.getElementById(this.view.id + &quot;-searchcount&quot;).childNodes[0].nodeValue = this.view.lang['msg_search_results'].split('$').join(toplevelcount + &quot;&quot;);<br/>
                  this.view.searchResultCount = toplevelcount// For Search View Display Correction<br/>
              }<br/>
      



      –> Changed "clearSearch()" to:

      this.clearSearch = function(){<br/>
          if(this.searchQuery){<br/>
              this.changeState(&quot;selectedEntryPosition&quot;,&quot;1&quot;);<br/>
              this.searchQuery = &quot;&quot;;<br/>
              this.searchResultCount = &quot;&quot;;// For Search View Display Correction<br/>
              document.getElementById(this.id + &quot;-searchcount&quot;).childNodes[0].nodeValue = &quot;&quot;;<br/>
              this.reset();<br/>
          }<br/>
      



      –> Added the noted lines below to the "drawRows()" function:

              if(tbody.rows.length &gt; this.linesToShow + 2){<br/>
                  var rowToRemove = tbody.rows[tbody.rows.length-1];<br/>
                  if(rowToRemove.notesViewEntry)rowToRemove.notesViewEntry.tableRow = null;<br/>
                  tbody.removeChild(rowToRemove);<br/>
              }<br/>
      

      // Begin of lines added to resolve Search View Display problem

                          if(this.searchResultCount!=&quot;&quot; &amp;&amp; this.searchResultCount &gt; 0){<br/>
                           if(i==(this.searchResultCount-1)){<br/>
                            entry=null;<br/>
                           }<br/>
                          }<br/>
      

      // End of lines added to resolve Search View Display problem

              if(!entry || entry.getMoreChildren || entry.getMoreRows){