"SELECT \"users\".* FROM \"users\" LEFT OUTER JOIN \"profiles\" ON \"profiles\".\"user_id\" = \"users\".\"id\" WHERE (((\"profiles\".\"last_name\" ILIKE '%jane%' OR \"profiles\".\"last_name\" ILIKE '%doe%') OR (\"profiles\".\"first_name\" ILIKE '%jane%' OR \"profiles\".\"first_name\" ILIKE '%doe%')))"
which returns the expected results... But how to implement this request in my search form (in my view) and/or in my controller ?
"SELECT \"users\".* FROM \"users\" LEFT OUTER JOIN \"profiles\" ON \"profiles\".\"user_id\" = \"users\".\"id\" WHERE (((\"profiles\".\"last_name\" ILIKE '%jane doe%') OR (\"profiles\".\"first_name\" ILIKE '%jane doe%')))"
but how to implement the split(' ') to have the expected SQL ?
Any help (and a bit of explanation) would be great, documentation is a bit light on the subject...
Cheers
So if it displays well in your example it throw errors when filtering server-side with an error "JSON data from server could not be parsed. This is caused by a JSON formatting error"
Is there anybody who knows how to return the well formatted JSON ?
Any help would be appreciate
Now when the page loads I have an error "reference error : aSelected is not defined" in the "fnRowCallBack" function, I see the datas in the table and the 'processing indicator'...
Any help on this would be very appreciated
Cheers
By the way, the example provided in dataTables.net uses jQuery.live function which is obsolete since version 1.7, I changed it to '.on'
Hello
Need some help on this
I wiould like to do something like that :
the SQL generated is the following
"SELECT \"users\".* FROM \"users\" LEFT OUTER JOIN \"profiles\" ON \"profiles\".\"user_id\" = \"users\".\"id\" WHERE (((\"profiles\".\"last_name\" ILIKE '%jane%' OR \"profiles\".\"last_name\" ILIKE '%doe%') OR (\"profiles\".\"first_name\" ILIKE '%jane%' OR \"profiles\".\"first_name\" ILIKE '%doe%')))"
which returns the expected results... But how to implement this request in my search form (in my view) and/or in my controller ?
My search form is :
As it is the SQL returned is
"SELECT \"users\".* FROM \"users\" LEFT OUTER JOIN \"profiles\" ON \"profiles\".\"user_id\" = \"users\".\"id\" WHERE (((\"profiles\".\"last_name\" ILIKE '%jane doe%') OR (\"profiles\".\"first_name\" ILIKE '%jane doe%')))"
but how to implement the split(' ') to have the expected SQL ?
Any help (and a bit of explanation) would be great, documentation is a bit light on the subject...
Cheers
EDIT
the requested 2D array expected by DataTables should be read with ' " ' (double quotes) around the right side of the pair for each attributes
Hello
It appears that the JSON array returned is not what is expected by DataTables.
Let say for a model User where mapping returns user.id, user.last_name, user.first_name, user.email...
the returned JSON is
wich is a one dimension array, and the 2 dimensions arraay expected by DataTables (for the aaData part) should be for the same set of data
So if it displays well in your example it throw errors when filtering server-side with an error "JSON data from server could not be parsed. This is caused by a JSON formatting error"
Is there anybody who knows how to return the well formatted JSON ?
Any help would be appreciate
Try
Cheers
Hello Pramsay
I know this post is a bit old but did you solved your problem ? I'm facing the same wall and can't find solution
Hello
I have a dataTable with nested models. I use server side processing and all works fine (search on multiple columns, sorting).
Now I need to add multiple row selection and send selected objects ids to my controller.
But I can't implement the multiple row selection. I followed the example on "http://datatables.net/release-datatables/examples/server_side/select_rows.html". I changed my users.coffee.js file to users.js to not have to mess with CoffeeScript.
Now when the page loads I have an error "reference error : aSelected is not defined" in the "fnRowCallBack" function, I see the datas in the table and the 'processing indicator'...
Any help on this would be very appreciated
Cheers
By the way, the example provided in dataTables.net uses jQuery.live function which is obsolete since version 1.7, I changed it to '.on'