My index tables have a form below the heading to allow users to filter
data. When using ajax pagination the form disappears after the first
request. Normal pagination works fine. The form does show up in the
html returned by ajax but it almost seems as if its getting rendered
off the screen. I have even tried standard and ajax forms for the
filtering. Snippet of my pagination, heading and filter form ($columns
is an array of key-value pairs for the fields to display):
<tr>
<?php if($this->params['action'] == 'index'): ?>
<?php $paginator-
>options(array('update'=>'centerColumn','indicator' => 'loading'));?>
<?php foreach($columns as $column): ?>
<th>
<?php
if(array_key_exists('sort',$paginator->params['named'])){
if($paginator->params['named']['sort'] ==
$column['field']){
echo $paginator->sort($column['title'],
$column['field'],array('class'=>$paginator->sortDir()));
}
else{
echo $paginator->sort($column['title'],
$column['field']);
}
}
else{
echo $paginator->sort($column['title'],
$column['field']);
}
?>
</th>
<?php endforeach; ?>
<?php else: ?>
<?php foreach($columns as $column): ?>
<th><?php echo $column['title'];?></th>
<?php endforeach; ?>
<?php endif; ?>
<th class="actions">Actions</th>
</tr>
<tr>
<?php //echo $form->create(null, array('action'=>'/index')); ?>
<?php echo $ajax->form('/
index','post',array('update'=>'centerColumn','indicator' =>
'loading')); ?>
<?php foreach($columns as $column): ?>
<td style="text-align:center;margin:0;padding:0;width:auto;">
<?php echo $form-
>input($column['field'],array('div'=>false,'label'=>''));?>
</td>
<?php endforeach; ?>
<td class="actions">
<?php echo $form-
>end(array('label'=>'filter','id'=>'filter_submit','style'=>'display:none;'));?
>
</td>
</tr>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---