Note that there are some explanatory texts on larger screens.

plurals
  1. POAnother JQuery Component within JQuery UI Tabs with Ajax Page Calls
    primarykey
    data
    text
    <p>I am currently usng JQuery U Tabs with Ajax Page Calls. Within the Pages I have a custom scroller which is working correctly. I also have an ajax search table, which is working when the page is being loaded on its own in the browser but not when it's called within the JQuery UI tabs.</p> <p>The following is the code for the JQuery UI Tabs.</p> <p>Javascript Call</p> <pre><code> &lt;script&gt; $(function() { // getter var heightStyle = $( ".selector" ).tabs( "option", "heightStyle" ); // setter $( ".selector" ).tabs( "option", "heightStyle", "fill" ); $( "#tabs" ).tabs({ beforeLoad: function( event, ui ) { ui.jqXHR.error(function() { ui.panel.html( "Couldn't load this tab. We'll try to fix this as soon as possible. " + "If this wouldn't be a demo." ); }); } }); }); &lt;/script&gt; </code></pre> <p>HTML:</p> <pre><code>&lt;div id="tabs"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#tabs-1"&gt;View&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="page2.html"&gt;Add&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="page3.html"&gt;Modify&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="tabs-1"&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>The following is the code within page2.html:</p> <pre><code>&lt;div class="tables"&gt; &lt;div id="content_3" class="content"&gt; &lt;div class="search"&gt; &lt;div class="searchtitle"&gt;Search&lt;/div&gt; &lt;label for="search"&gt;&lt;input type="text" id="search"/&gt;&lt;/label&gt; &lt;/div&gt; &lt;table id="tblData" class="target"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;th width="110px"&gt;Course&lt;/th&gt; &lt;th width="92px"&gt;Group&lt;/th&gt; &lt;th width="204px"&gt;Period&lt;/th&gt; &lt;th width="81px"&gt;Room&lt;/th&gt; &lt;th width="117px"&gt;Actions&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="odd"&gt;Unit 1&lt;/td&gt; &lt;td class="odd"&gt;Group 2&lt;/td&gt; &lt;td class="odd"&gt;00-00-00 - 00-00-00 &lt;/td&gt; &lt;td class="odd"&gt;Room 1&lt;/td&gt; &lt;td class="odd"&gt;&lt;img src="../../Images/actions-delete-icon-normal.png"/&gt;&lt;img src="../../Images/actions-edit-icon-normal.png"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="even"&gt;Unit#&lt;/td&gt; &lt;td class="even"&gt;###&lt;/td&gt; &lt;td class="even"&gt;00-00-00 - 00-00-00 &lt;/td&gt; &lt;td class="even"&gt;Room 2&lt;/td&gt; &lt;td class="even"&gt;&lt;img src="../../Images/actions-delete-icon-normal.png"/&gt;&lt;img src="../../Images/actions-edit-icon-normal.png"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="odd"&gt;Unit#&lt;/td&gt; &lt;td class="odd"&gt;###&lt;/td&gt; &lt;td class="odd"&gt;00-00-00 - 00-00-00 &lt;/td&gt; &lt;td class="odd"&gt;###&lt;/td&gt; &lt;td class="odd"&gt;&lt;img src="../../Images/actions-delete-icon-normal.png"/&gt;&lt;img src="../../Images/actions-edit-icon-normal.png"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt; &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $('#search').keyup(function() { searchTable($(this).val()); }); }); function searchTable(inputVal) { var table = $('#tblData'); table.find('tr').each(function(index, row) { var allCells = $(row).find('td'); if(allCells.length &gt; 0) { var found = false; allCells.each(function(index, td) { var regExp = new RegExp(inputVal, 'i'); if(regExp.test($(td).text())) { found = true; return false; } }); if(found == true)$(row).show();else $(row).hide(); } }); } &lt;/script&gt; </code></pre> <p>I am suspecting that it's the <em>$(document).ready(function()</em> from within the Javascript in page2.html which is not firing.</p> <p>Any help on solving this issue?</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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