![]() |
Ignited DataTables - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Ignited DataTables (/showthread.php?tid=32173) |
Ignited DataTables - El Forum - 09-12-2012 [eluser]ηυмвєяσηє[/eluser] i didnt like the latest changes of the library so i decide to continue from my latest commit.. So here is what ive done for today, - Added group_by and like functions - renamed 'add_columns' and 'edit_columns' functions to 'add' and 'edit'. it is way more simple. https://github.com/n1crack/Ignited-Datatables note: The latest official datatables also includes distinct and or_where functions. It doesnt fit those functions in this library. If you want to use or_where function simply : Code: ->where(' (length = "46" OR length = "47") ' ,NULL,FALSE) Ignited DataTables - El Forum - 09-17-2012 [eluser]Unknown[/eluser] Hi all, I have a problem with jquery datatables when I use group_by. The data loaded in the datatable are correct but records count shown in the footer of the datatable is bad. Can somebody help me with this? Thanks Matoo Ignited DataTables - El Forum - 10-19-2012 [eluser]ninjayan[/eluser] Totally new to this. I want to use on the application I am developing. This is a great library. Can someone give me a working example? Or just a tutorial link? I also want to add 1 column at the end for actions(select/delete) thanks Ignited DataTables - El Forum - 10-19-2012 [eluser]ZaLiTHkA[/eluser] [quote author="ninjayan" date="1350639894"]Totally new to this. I want to use on the application I am developing. This is a great library. Can someone give me a working example? Or just a tutorial link? I also want to add 1 column at the end for actions(select/delete) thanks [/quote] This CI library is built around the 'server side' data source as seen in this example. It doesn't include DataTables itself. ![]() Ignited DataTables - El Forum - 10-19-2012 [eluser]ninjayan[/eluser] I have datatables working on plain php but now i want to use it in codeigniter. So I came over here and found this. If this is not what I'm looking for, can you give me links/tutorials/samples how to implement datatables in codeigniter? Ignited DataTables - El Forum - 10-20-2012 [eluser]ninjayan[/eluser] I have this current code. Code: $this->load->library('datatables'); add_coumn is not working Ignited DataTables - El Forum - 10-20-2012 [eluser]ZaLiTHkA[/eluser] [quote author="ninjayan" date="1350735874"]I have this current code. Code: $this->load->library('datatables'); add_coumn is not working[/quote] Ah, I see what you mean now. Sorry, I misunderstood your first post.. My mistake. ![]() Just to confirm, is this code in your controller or your model? Is the data getting through if you try without the add_column() method in the chain? If I remember correctly, when I tried this I only got it to work after using print() at the end of the $this->datatables() chain. Here's the relevant code from a recent project I worked on: Code: // MY_Controller In this case, I set the AJAX source in my DT initialization to a url generated by: Code: echo(base_url('my_controller/get_list')); Not sure if there's a better way to do this, but this worked for me. Just a thought, but maybe try use print() instead of echo() on your generate() line. Ignited DataTables - El Forum - 10-20-2012 [eluser]ninjayan[/eluser] Thanks for replying. My code is only at the controller. I haven't tried yet to put it on my model. Ignited DataTables - El Forum - 10-20-2012 [eluser]ninjayan[/eluser] Ok, I think I have to show you the codes. controller Code: public function get_active_users() { view: Code: [removed] I want to add a column Action after the 'Date Registered'. Content of it will be icon disable user, promote/remove as admin. Ignited DataTables - El Forum - 10-21-2012 [eluser]ZaLiTHkA[/eluser] [quote author="ninjayan" date="1350788692"]I want to add a column Action after the 'Date Registered'. Content of it will be icon disable user, promote/remove as admin.[/quote] I suspect the biggest issue here is the fact that the number of columns between your data source (in your controller) and the number of columns in your end table (in your view), do not match. You're trying to put data for 8 columns into a 7 column table. Out of curiosity, have you tried adding an extra column to your HTML table in your view? Sometimes the simplest solution works out best in the end. Unfortunately though, DataTables itself doesn't support dynamically adding columns, this question has been asked many times on the DT forum in the past. Digging through these questions again this morning, I found a link to a tutorial that looks like it does exactly what you're asking for [link]. Otherwise, have you considered using something like the drill-down rows example, placing the 'user specific functions' in the row that shows up below the clicked row? This way, the data is added dynamically to the row before it's displayed, and the row is destroyed after it's hidden. It's very easy to use and very efficient as well. This is giving me ideas for another project I'm working on now.. Time to go play. (: |