CodeIgniter Forums
customized pagination using pagination class - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: customized pagination using pagination class (/thread-33181.html)

customized pagination using pagination class - El Forum - 08-18-2010

Hi Guys,

I'm just starting with CI, I'm developing a application here i want to achieve this functionality

* Display a user interface to a person with pagination enabled.
* those pagination items must have a link in them (for each item),so when i click one of them
another user interface will be loaded and i have the opportunity to enter the data
to the selected item.
* then after he successfully modified the data, it should be returned to the previous
user interface(pagination interface) there the entry i edited must not be displayed and
it must be not shown in the list now!

can i achieve this using existing pagination class? need a big help with this guys?
please help me out!


customized pagination using pagination class - El Forum - 08-25-2010

Not sure why you would NOT want to display something after editing it - because this surely counts as a delete?

But I do the following, in pagination situations where I need an edit/update facility (this is in the view):

<?php if ($items) : ?>
          &lt;?php foreach ($items as $item) : ?&gt;
                    <td>&lt;?= $item['id'] ?&gt;</td><td>&lt;?= $item['title'] ?&gt;</td><td><a href="/controller/edit_action/&lt;?= $item['id'] ?&gt;" target="_BLANK">Edit</a></td>
          &lt;?php endforeach; ?&gt;
&lt;?php endif; ?&gt;

This way then you can build an edit view that is called from the /controller/edit_action method, and accepts the ID of the item you wish to edit as URI segment 3.

_BLANK will obviously open this in a new window.

Does this help at all?