Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82039

Server side processing - Server/Client column independance

$
0
0
I want to have my server side and client side processing as independant of each other as possible. I have to a large extent got this but a few gliches have appeared.

1) On the server I return in Jason $data['sColumns'] = implode(",", $att); where $att contains my column names that I get from the table definition. This is fine. DataTables handles it.
On the client side I have the same columns defined. Also fine
"aoColumns": [
        //Define all the fields from the server in the order they must be displayed
	{"sName":"id"',				 bVisible:false, bSearchable:false},
	{"sName":"type"},
	{"sName":"sequence"},
	{"sName":"language"},
	{"sName":"desc"},
	{"sName":"created_at"},
	{"sName":"updated_at"},
	{"sName":"old_id"},
],
BUT now I add a coulmn to the table, the returned Jason $data['sColumns'] has an extra column. Bang - get the "unknown parameter 'aaa' from data source..." error. Can I do something to fix this. I don't want to have to change code just because I have added a database column.

2) I need either the name or id set in the cells. The above code doesn't set either at the cell level. If I use mData it is set but I loose my server/client independance. Get the 'Unknown' error again. Any ideas? Ideally sName should set the id at cell level :)

3) I 'order by' in my sql query. I would like to set aaSorting array from the server so that I get the funky little arrows etc. Is this possible? I use the same layout with different sort sequences for different circumstances. Also it is my intention to allow the users to specify the sequence they want at run time and then save it. I am after all producing a 'package solution'

Viewing all articles
Browse latest Browse all 82039

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>