|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
jens37 Smarty n00b
Joined: 13 Jul 2016 Posts: 1
|
Posted: Wed Jul 13, 2016 9:16 am Post subject: Smarty Bootstrap Data Table |
|
|
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 |
|
Grizzly Smarty Pro
Joined: 15 Apr 2011 Posts: 172 Location: Germany
|
Posted: Tue Jul 19, 2016 7:03 am Post subject: |
|
|
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 |
|
|
|
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
|