Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Smarty Bootstrap Data Table

 
Post new topic   Reply to topic    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
jens37
Smarty n00b


Joined: 13 Jul 2016
Posts: 1

PostPosted: Wed Jul 13, 2016 9:16 am    Post subject: Smarty Bootstrap Data Table Reply with quote

Hallo, Ich habe folgendes Problem:

Code:
{section name=x loop=$aProgramm}
<tr>
<td>{$aProgramm[x].anzeigepic}</td>
<td>{$aProgramm[x].verguetung}</td>
</tr>
{/section}


jetzt würde ich gern das in Bootstrap Data Table einbauen.
hier ein Beispiel :
Code:
<div class="">
        <table id="example" class="display" width="100%" cellspacing="0">
        <thead>
            <tr>
                <th>Empid</th>
                <th>Name</th>
                <th>Salary</th>
               
            </tr>
        </thead>
 
        <tfoot>
            <tr>
               <th>Empid</th>
                <th>Name</th>
                <th>Salary</th>
               
            </tr>
        </tfoot>
    </table>
    </div>

$( document ).ready(function() {
$('#example').dataTable({
                 "bProcessing": true,
                 "sAjaxSource": "response.php",
                 "aoColumns": [
                        { mData: 'Empid' } ,
                        { mData: 'Name' },
                        { mData: 'Salary' }
                ]
        });   
});
  $data = array(
                            array('Name'=>'parvez', 'Empid'=>11, 'Salary'=>101),
                            array('Name'=>'alam', 'Empid'=>1, 'Salary'=>102),
                            array('Name'=>'phpflow', 'Empid'=>21, 'Salary'=>103)                            );
             

    $results = array(
            "sEcho" => 1,
        "iTotalRecords" => count($data),
        "iTotalDisplayRecords" => count($data),
          "aaData"=>$data);

echo json_encode($results);

und das geht bei smarty einfach nicht
Back to top
View user's profile Send private message
Grizzly
Smarty Pro


Joined: 15 Apr 2011
Posts: 166
Location: Germany

PostPosted: Tue Jul 19, 2016 7:03 am    Post subject: Reply with quote

Es ist schwierig zu sagen, was du brauchst, wenn du nur einfach sagst "es geht nicht".

Was genau geht denn nicht. In dem Code-Bespiel ist HTML, JS/jQuery/DataTable und PHP Code in einem.

Wir müssen schon wissen, wie es aufgeteilt ist und wa sgenau nicht geht.

Das erste was ich sagen kann, wenn du javascript im Template einbaust, musst du es innerhalb des Smarty-Literal Tags machen. Und vllt auch mal ein script-tag öffnen.

Bitte schicke doch den Code der jeweiligen Dateien (php, js, tpl etc.)
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP