![]() |
How to make sortable table links Tip - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12) +--- Thread: How to make sortable table links Tip (/showthread.php?tid=1198) |
How to make sortable table links Tip - wolfgang1983 - 02-18-2015 I thought I might share a sortable table code example that I made. I have tried a couple that I found on git hub but were out dated and did not work. So made my own, this code below should work with codeigniter 2.2.1 and codeigniter 3 which what this is made on. Here is just a example of how to do sort th table table links with codeigniter model. You can change the code around any way you like. Routes.php PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Example Controller: PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Example Users Model: PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Example View: Code: <div class="table-responsive"> RE: How to make sortable table links Tip - aurelien - 02-18-2015 Hi, nice job. You should watch : DataTables I use it all time, very easy and powerful ! => Exemple whit bootstrap RE: How to make sortable table links Tip - wolfgang1983 - 02-18-2015 (02-18-2015, 09:09 AM)aurelien Wrote: Hi, nice job. I have used. It OK prefer to try and make my own built in. RE: How to make sortable table links Tip - ivantcholakov - 02-18-2015 Yup, Datatables. I can do full CRUD with PHP (filter/search, sorting, pagination, state keeping within the session), but with Datatables script it is much easier. http://iridadesign.com/starter-public-edition-4/www/playground/datatables/ssp RE: How to make sortable table links Tip - RWCH - 02-20-2015 What aurelien said, use DataTables (www.datatables.net) and never look back. Do not try to reinvent the wheel. |