- initialize_table: function()
- {
- /* Transforms the table into DataTable, and keep a pointer to it */
- var self = this;
- var actual_options = {
- // Customize the position of Datatables elements (length,filter,button,...)
- // we use a fluid row on top and another on the bottom, making sure we take 12 grid elt's each time
- sDom: "<'row'<'col-xs-5'l><'col-xs-1'r><'col-xs-6'f>>t<'row'<'col-xs-5'i><'col-xs-7'p>>",
- // XXX as of sept. 2013, I cannot locate a bootstrap3-friendly mode for now
- // hopefully this would come with dataTables v1.10 ?
- // in any case, search for 'sPaginationType' all over the code for more comments
- sPaginationType: 'bootstrap',
- // Handle the null values & the error : Datatables warning Requested unknown parameter
- // http://datatables.net/forums/discussion/5331/datatables-warning-...-requested-unknown-parameter/p2
- aoColumnDefs: [{sDefaultContent: '',aTargets: [ '_all' ]}],
- // WARNING: this one causes tables in a 'tabs' that are not exposed at the time this is run to show up empty
- // sScrollX: '100%', /* Horizontal scrolling */
- bProcessing: true, /* Loading */
- fnDrawCallback: function() { self._querytable_draw_callback.call(self); }
- // XXX use $.proxy here !
- };
- // the intention here is that options.datatables_options as coming from the python object take precedence
- // xxx DISABLED by jordan: was causing errors in datatables.js
- // xxx turned back on by Thierry - this is the code that takes python-provided options into account
- // check your datatables_options tag instead
- // however, we have to accumulate in aoColumnDefs from here (above)
- // and from the python wrapper (checkboxes management, plus any user-provided aoColumnDefs)
- if ( 'aoColumnDefs' in this.options.datatables_options) {
- actual_options['aoColumnDefs']=this.options.datatables_options['aoColumnDefs'].concat(actual_options['aoColumnDefs']);
- delete this.options.datatables_options['aoColumnDefs'];
+ initialize_table: function() {
+ // compute columns based on columns and hidden_columns
+ this.slick_columns = [];
+ var all_columns = this.options.columns; // .concat(this.options.hidden_columns)
+ for (c in all_columns) {
+ var column=all_columns[c];
+ this.slick_columns.push ( {id:column, name:column, field:column, width:100, minWidth:40, });