-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to make searching, filter and paging into server side ? #103
Comments
Hey, Which version of DataTables are you running? The only thing that I can spot is "columns" param, try specifying "name" param within curly brackets. "columns": [ Also it would be interesting to know on which library have you used to handle datatables in CI? Vlad. |
@spikerok, Thank you for answering my question. Datatables version I use is DataTable version 1.10.4. While Ignited-Datatables version I use is Ignited-Datatables version 2.0. |
@spikerok, I tried to remove the function get_filtering in Ignited-Datatables Library and I adding new functions(function formatArraySearch) in the library like this : http://pastebin.com/gY85LhuQ. I changed the controller and javascript like this : I'ts working. But I have difficulty in search by column |
Try this library: http://pastebin.com/GreAs3tG |
It is not working. I tried searching, paging and order, but was not successful. |
Library: http://pastebin.com/GreAs3tG |
@spikerok, Thank you very much for answering my question. I see his library there are two deficiencies
|
solved In the datatables library, I replace the get filtering function to be like this : private function get_filtering()
} It's working Whether the solution is correct? |
Hi.
I have also played around today with the script and made small adjustments to get_filtering and get_ordering.. When you define datatables is JS you can specify which column within array that datatables receives data can be found for a particular cell and also you can specify which column in database should be used if you are to search / sort a particular column. i.e.
"name" contains the column name that will be used to sort / search with. i.e. If type in search "100" my database query would be something similar to:
"data" contains the key for data within array that datatables library returns. i.e. in controller we have a method that is called using AJAX
|
I have updated library online: http://pastebin.com/GreAs3tG I have added global and local filtering. |
@spikerok, Hi
private function get_filtering()
} I've done the experiment and it worked I modified the library datatables like this : http://pastebin.com/u30iAky0# If you update the datatables library? At that time, seemed the datatables library used : http://pastebin.com/qpKMLfa3 |
Ok, i see, we will need to use active record for queries and see how that works out.. i will try to update library sometime today and see what happens. |
@spikerok, Ok. Thank you very much |
I didnt have a chance to look at this yet, but, i am not sure if active record can support complex queries, might need to have a interface to handle db queries. |
why i using $this->datatables->where ('work.work_id','VOID','!='); anybody know about this problem? Thank you |
@rooniieesss we would need to see how you are initiating datatables, possibly see some of your code. From your error message, it might be to do with your datatables class or with how you set it up. |
My application use CodeIgniter.
Library that I use is Ignited-datatables Library.
My controller is like this :
public function get_book()
{
$this->datatables->select('id, hotel, city, country, region')
->unset_column('id')
->from('hotel_book')
echo $this->datatables->generate('json', '');
}
My HTML is like this:
My Javascript is like this:
Thank you.
The text was updated successfully, but these errors were encountered: