Ignited Datatables // php library - Page 3

Ignited Datatables // php library



  • bwijnsbwijns Posts: 6Questions: 0Answers: 0
    @ boylesn and others: If you want to be able to 'show all' then you have to edit datatables.php line 225 to:

    [code]$this->ar->limit(($iLength != '' && $iLength != '-1')? $iLength : '', ($iStart)? $iStart : 0);[/code]
  • tellsapfeltellsapfel Posts: 1Questions: 0Answers: 0
    edited September 2013
    @numerone thanks for helping the community

    I too get an error in line 377 in Datatables.php (invalid arguments in foreach ..) with your examples.
    How can it be fixed?

  • bwijnsbwijns Posts: 6Questions: 0Answers: 0
    Are there updates planned for the "IgnitedDatatables-native-php-version"?

    In the Codeigniter library updates as group_by (I really need this) are made, but not in the native php version. Is it possible to do this? I don't have enough knowledge to do this :(
  • abrenochabrenoch Posts: 1Questions: 0Answers: 0
    edited January 2014

    I have made an attempt at including the 'group_by' function (seems to be working alright for me), you can download a modified version from my branch of the project:


    It should support multiple columns in the same syntax mysql uses (separated by commas), and you use it like you would the codeigniter version [ ->group_by('column') ]

    Hope this helps!
  • bwijnsbwijns Posts: 6Questions: 0Answers: 0
    @ abrenoch: Thank you for the update! I'll test it when I have the time.
  • yahyaerturanyahyaerturan Posts: 4Questions: 0Answers: 0

    My question is on callbacks.

    Below works great because "reformat_datetime" is helper. And can be accessed globally.
    [code]$this->datatables->edit_column('domain_expiry', '$1', 'reformat_datetime(domain_expiry)');[/code]

    But this one is not working. And this is Codeigniter. I shouldn't have do it in helper.
    [code]$this->datatables->edit_column('domain_days_left','$1', '$this->checkdays(domain_days_left)');[/code]

    Any idea?
  • flyersunflyersun Posts: 1Questions: 0Answers: 0

    I'm having the same issue with edit_column the script can't find my function. Has any one found a solution for this?

  • pansengtatpansengtat Posts: 66Questions: 26Answers: 1

    @numberone, thanks for sharing this plugin. I do have some questions lingering.

    If all along I have been using DataTables/Editor native method of instantiating fields in my instance of DataTables using their leftJoin() and Editor::inst(...)->process($_POST)->data(), and if should I choose to use IgnitedDataTables, do I need to discard all the code I used in the original code calls into the format provided in IgnitedDatatables? The reason I asked is that initially I have been using only Left Joins and differentiate different rows using Editor::inst($db, 'TableName', 'ID'), but now I feel the necessity to include aggregate functions like GROUP BY and SUM() because I was being requested by a client to include summed-up data in the column itself as opposed to being in the footer of the table. Do you have any insights into this?

  • tom_hernandeztom_hernandez Posts: 4Questions: 2Answers: 0
    edited January 2015

    I have problem too with callbacks on edit_column someone could solve it or have idea...???

  • numberonenumberone Posts: 86Questions: 0Answers: 0
    edited January 2015

    Hello guys,

    I am sorry i couldn't improve the library so far because of my works.. Now, I rewrote the library. Still need some more tests before actual release.

    Your ajax file will be like this: (sakila db for example):

    $dt = new Datatables(new MySQL, $config);
    $dt->query("Select film.film_id as id, title, description, rental_rate, category_id from film left join film_category on film_category.film_id = film.film_id where film.film_id > 2 and film.film_id < 55");
    echo $dt->generate();

    thats all. it is simple and easy to use :)

    have tried 2 complex queries so far and it just works :)

    $dt->query("SELECT c.name AS category,sum(p.amount) AS total_sales FROM ((((payment p join rental r on p.rental_id = r.rental_id ) join inventory i on r.inventory_id = i.inventory_id ) join film f on i.film_id = f.film_id ) join film_category fc on f.film_id = fc.film_id ) join category c on fc.category_id = c.category_id  group by c.name order by total_sales desc;");
    $dt->query("select first_name, last_name, email, sum(payment.amount) as pa, rental_id from customer  JOIN  payment on customer.customer_id = payment.customer_id group by email;");

    You will be able to install the library via composer.(it is awesome ^^)
    You will be able to add custom columns or edit columns as before.

    Stay tuned :)

  • anithaanitha Posts: 1Questions: 0Answers: 0

    I need datatable library for my custom component , i have download library form https://github.com/n1crack/IgnitedDatatables-php-library, changed database details in ajax.php from example folder and run basic_init but it shows "DataTables warning: table id=example - Invalid JSON response. For more information about this error, please see http://datatables.net/tn/1" is this anything i need to configure

  • allanallan Posts: 48,888Questions: 1Answers: 7,125 Site admin

    I expect it would be useful if you were to post whatever the Ajax return is - likely it will contain an error message like the tech note the error message links to states.


This discussion has been closed.