Search & Sort with server-side
Search & Sort with server-side
Hi everyone!
Congrats for DT. Awesome job.
I have one situation here:
Using server-side, i need using "alias" for columns, because the join is at same table:
Table location
Location source
Location destiny
So, in $joinQuery:
..
LEFT JOIN localidad GO ON A.mxv_loc_ori_fk = GO.loc_id
LEFT JOIN localidad GD ON A.mxv_loc_dest_fk = GD.loc_id
..
And, in $columns:
array(
array( 'db' => '(GO
.loc_nombre
) as origen', 'dt' => "origen", 'field' => 'origen'),
array( 'db' => '(GD
.loc_nombre
) as destino', 'dt' => 'destino', 'field' => 'destino' )
);
**And, in JS:
"columns": [
{"data":"origen"},
{"data":"destino"}
]
**
ALL GOOD at this point! The columns show the info correctly.
The problem is at the moment at i try to SEARCH and FILTER.
I cannot understand why, but it doesn't work!
Please help!
This question has an accepted answers - jump to answer
Answers
Hi,
Unfortunately that isn't a feature that the demo SSP script provides at the moment. The script would need to be modified to add that feature.
Allan
Hi Allan! Thx for quick response.
So the only thing i cant try is using client-side dt no?
Ok this was my resolution for the problem:
create a view in mysql for "localidad" (eg: view_localidad), so the SQL server-side part change to:
LEFT JOIN view_localidad GO ON A.mxv_loc_ori_fk = GO.vloc_id
LEFT JOIN localidad GD ON A.mxv_loc_dest_fk = GD.loc_id
At the moment, works great!