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 :(
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') ]
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]
@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?
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 :)
// SAMPLE QUERIES THAT WORKS ATM.
$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.
Hi,
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
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.
Replies
[code]$this->ar->limit(($iLength != '' && $iLength != '-1')? $iLength : '', ($iStart)? $iStart : 0);[/code]
I too get an error in line 377 in Datatables.php (invalid arguments in foreach ..) with your examples.
How can it be fixed?
thanks
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 :(
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:
https://github.com/abrenoch/IgnitedDatatables-php-library
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!
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?
I'm having the same issue with edit_column the script can't find my function. Has any one found a solution for this?
@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()
andEditor::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 usingEditor::inst($db, 'TableName', 'ID')
, but now I feel the necessity to include aggregate functions likeGROUP BY
andSUM()
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?I have problem too with callbacks on edit_column someone could solve it or have idea...???
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):
thats all. it is simple and easy to use :)
have tried 2 complex queries so far and it just works :)
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 :)
Hi,
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
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.
Allan
This is old topic.
Try
http://datatables.net/forums/discussion/25535/datatables-php-library-new#latest