Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You would just use:</p> <pre><code>unsafeWindow.iDisplayLength = -1; </code></pre> <p>No need for any of that <code>changeTheDefaultViewVarLol()</code> stuff.</p> <p><strong>However,</strong> this will not have the effect that you want if <code>iDisplayLength</code> is used by the page just after the page sets it to 25.</p> <p>You will probably have to call a JS function to apply the new value. Link to the target page if this is the case.</p> <hr> <hr> <h2>Update for additional page information:</h2> <p>What you are actually trying to do is to invoke the "Show All entries" functionality of that page.</p> <p>So, don't think in terms of poking JS variables, think in terms of activating whatever JS is tied to that <code>&lt;select&gt;</code>.</p> <p>For a <strong><em>normal</em></strong> page similar to <a href="http://tf2spreadsheet.blogspot.com/" rel="nofollow">the one you specified</a>, code like this <em>would</em> do it: </p> <pre><code>var showAllOpt = document.querySelector ('#main_table_length select option[value="-1"]'); var changeEvent = document.createEvent ("HTMLEvents"); if (showAllOpt) { showAllOpt.parentNode.selectedIndex = showAllOpt.index; changeEvent.initEvent ("change", true, true); showAllOpt.parentNode.dispatchEvent (changeEvent); } </code></pre> <p><br> <strong>BUT,</strong> <a href="http://tf2spreadsheet.blogspot.com/" rel="nofollow">that page</a> AJAXes-in the desired table long after the page "loads". So, an additional step is needed, like so:</p> <pre><code>var showAllEntriesSelect = setInterval ( function() { setSelectValueWhenitLoads ( "#main_table_length select option", "-1", showAllEntriesSelect ); } , 200 ); function setSelectValueWhenitLoads (cssSelector, targetValue, timerVar) { var showAllOpt = document.querySelector ( cssSelector + '[value="' + targetValue + '"]' ); if (showAllOpt) { clearInterval (timerVar); showAllOpt.parentNode.selectedIndex = showAllOpt.index; var changeEvent = document.createEvent ("HTMLEvents"); changeEvent.initEvent ("change", true, true); showAllOpt.parentNode.dispatchEvent (changeEvent); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload