Fix AJAX :
[platal.git] / templates / table-editor.tpl
index 7226fc2..c4b376d 100644 (file)
 <h1>{$title}</h1>
 
 {if $list}
-
+<script type="text/javascript">
+       {literal}
+       function redirect(a) {
+               document.location = a;
+       }
+       {/literal}
+</script>
 <table class="bicol">
 <tr>
-  {foreach from=$t->vars item=myval}{if $myval.display}
-    <th>{$myval.desc}</th>
+  {foreach from=$t->vars item=myval key=myvar}{if $myval.display}
+    <th style="cursor:pointer" onclick="redirect('{$t->pl}/sort{if $t->sortfield eq $myvar && !$t->sortdesc}desc{/if}/{$myvar}')">{$myval.desc}{if $t->sortfield eq $myvar}{if $t->sortdesc}{icon name="bullet_arrow_down"}{else}{icon name="bullet_arrow_up"}{/if}{/if}</th>
   {/if}{/foreach}
   {if !$hideactions}
   <th>action</th>