0
如何在一個html頁面中使用兩個或多個小表格插件?我爲每個表格創建了一個單獨的php文件,但是當我在主頁面中包含.php文件時,唯一的工作表是第一個。在一個html頁面中有2個或更多個小表格
第一實施例
<link rel="stylesheet" href="../javascript/tinytable2/style.css"/>
<div id="tablewrapper">
<div id="tableheader">
<div class="search">
<select id="columns_areaLeader" onchange="sorter.search('query_areaLeader')"></select>
<input type="text" id="query_areaLeader" onkeyup="sorter.search('query_areaLeader')" />
</div>
<span class="details">
<div>Records <span id="startrecord_areaLeader"></span>-<span id="endrecord_areaLeader"></span> of <span id="totalrecords_areaLeader"></span></div>
<div><a href="javascript:sorter.reset()">reset</a></div>
</span>
</div>
<table cellspacing='0' id='table_areaLeader' cellpadding='0' class='tinytable'></table>
<div id="tablefooter">
<div id="tablenav_areaLeader">
<div>
</div>
<div>
<select id="pagedropdown_areaLeader"></select>
</div>
<div>
<a href="javascript:sorter.showall()">view all</a>
</div>
</div>
<div id="tablelocation">
<div>
<select onchange="sorter.size(this.value)">
<option value="5">5</option>
<option value="10" selected="selected">10</option>
<option value="20">20</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
<span>Entries Per Page</span>
</div>
<div class="page">Page <span id="currentpage_areaLeader"></span> of <span id="totalpages_areaLeader"></span></div>
</div>
</div>
<script type="text/javascript">
var sorter = new TINY.table.sorter('sorter','table_areaLeader',{
headclass:'head',
ascclass:'asc',
descclass:'desc',
evenclass:'evenrow',
oddclass:'oddrow',
evenselclass:'evenselected',
oddselclass:'oddselected',
paginate:true,
size:10,
colddid:'columns_areaLeader',
currentid:'currentpage_areaLeader',
totalid:'totalpages_areaLeader',
startingrecid:'startrecord_areaLeader',
endingrecid:'endrecord_areaLeader',
totalrecid:'totalrecords_areaLeader',
hoverid:'selectedrow_areaLeader',
pageddid:'pagedropdown_areaLeader',
navid:'tablenav_areaLeader',
sortcolumn:1,
sortdir:1,
sum:[8],
avg:[6,7,8,9],
columns:[{index:7, format:'%', decimals:1},{index:8, format:'$', decimals:0}],
init:true
});
</script>
第二Exapmple
記錄 - 的 復位 視圖所有 項每頁 的 <script type="text/javascript" src="../javascript/tinytable/script.js"></script>
<script type="text/javascript">
var sorter = new TINY.table.sorter('sorter','table_parishPriest',{
headclass:'head',
ascclass:'asc',
descclass:'desc',
evenclass:'evenrow',
oddclass:'oddrow',
evenselclass:'evenselected',
oddselclass:'oddselected',
paginate:true,
size:10,
colddid:'columns_parishPriest',
currentid:'currentpage_parishPriest',
totalid:'totalpages_parishPriest',
startingrecid:'startrecord_parishPriest',
endingrecid:'endrecord_parishPriest',
totalrecid:'totalrecords_parishPriest',
hoverid:'selectedrow',
pageddid:'pagedropdown_parishPriest',
navid:'tablenav',
sortcolumn:1,
sortdir:1,
sum:[8],
avg:[6,7,8,9],
columns:[{index:7, format:'%', decimals:1},{index:8, format:'$', decimals:0}],
init:true
});
</script>
頁面在這裏寫下你的源代碼,所以我們可以在哪裏確切的問題。可能是變量過載 – safarov 2012-03-18 00:38:29
http://caritasnovaliches.com/Pages/Caritas%20Coordinator/TableSelectAreaLeader.php - 這裏是一個表的鏈接http://caritasnovaliches.com/Pages/Caritas%20Coordinator/TableSelectParishPiest.php - - 這裏是另一個表的鏈接,我不能粘貼源代碼在這裏.. – ktumambing 2012-03-18 00:43:17
當我單獨嘗試它的作品.. – ktumambing 2012-03-18 00:45:11