2013-09-19 2 views
2

здесь я использую smarty в разделе главы, я добавляю всю jquery-мобильную библиотеку ... но я не могу добавить функциональность fillter .. я не знаю, что не так в моем коде .. я хочу добавить fillter вариант в моих DataTables ..jquery mobile datatables fillter

{extends file="./main.tpl"} 
{block name=head} 
    <meta name=viewport content="user-scalable=no,width=device-width" /> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css" /> 
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> 
    <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script> 
    <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> 
{/block} 
{block name=body} 
<table cellspacing="0" class="ui-responsive table-stroke" data-role="table" id="sample" data-mode="columntoggle" data-top-container="true" data-bottom-container="true" data-inset="true" data-filter="true" align="center" border="1"> 
    <h2 align="center"><b>Loan List</b></h2> 
    <tr> 
     <th align="center">Party</th> 
     <th align="center">Phone Number</th> 
     <th align="center">Date</th> 
     <th align="center">Amount</th> 
     <th align="center">Interst</th> 
     <th align="center">Given Amount</th> 
    </tr> 
    {section name="sec" loop=$loanListArray} 
    <tr> 
    <td align="left">{$loanListArray[sec].partyName}</td> 
     <td align="left">{$loanListArray[sec].phoneNumber}</td> 
     <td align="left">{$loanListArray[sec].loanDate|date_format:"%e-%m-%Y"}</td> 
     <td align="right">{$loanListArray[sec].amount}</td> 
     <td align="right">{$loanListArray[sec].interst}</td> 
     <td align="right">{$loanListArray[sec].givenAmount}</td> 
    </tr> 
    {/section} 
    <tr> 
     <th align="right" colspan="3">Total :</th> 
     <th>{$totalAmm}</th> 
     <th>{$totalInt}</th> 
     <th>{$totalgiven}</th>`enter code here` 
    </tr> 
    </table> 

{/block} 

ответ

1

определение таблицы нуждается в <thead> и <tbody> раздел. В документации JQM: «Обязательно включайте элементы thead и tbody в таблицу». Надеюсь, это поможет.