From: Jordan Augé Date: Thu, 19 Jun 2014 13:31:13 +0000 (+0200) Subject: renamed views.py in views/__init__.py X-Git-Tag: myslice-1.1~65 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=1d7ba6eead7f29bbd612a4ca81d0ec47d62befe3;p=unfold.git renamed views.py in views/__init__.py --- diff --git a/plugins/querytable/static/js/querytable.js b/plugins/querytable/static/js/querytable.js index 97fa4b45..c5411411 100644 --- a/plugins/querytable/static/js/querytable.js +++ b/plugins/querytable/static/js/querytable.js @@ -103,7 +103,24 @@ // 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); } + fnDrawCallback: function() { self._querytable_draw_callback.call(self); }, + fnRowCallback: function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { + // This function is called on fnAddData to set the TR id. What about fnUpdate ? + + // Get the key from the raw data array aData + var key = self.canonical_key; + + // Get the index of the key in the columns + var cols = self.table.fnSettings().aoColumns; + var index = self.getColIndex(key, cols); + if (index != -1) { + // The key is found in the table, set the TR id after the data + $(nRow).attr('id', self.id_from_key(key, aData[index])); + } + + // That's the usual return value + return nRow; + } // XXX use $.proxy here ! }; // the intention here is that options.datatables_options as coming from the python object take precedence @@ -453,7 +470,7 @@ if (debug) messages.debug("1-shot initializing dataTables content with " + this.buffered_lines.length + " lines"); this.table.fnAddData (this.buffered_lines); this.buffered_lines=[]; - + var self = this; // if we've already received the slice query, we have not been able to set // checkboxes on the fly at that time (dom not yet created) diff --git a/portal/static/js/onelab_slice-resource-view.js b/portal/static/js/onelab_slice-resource-view.js index 1f997d06..7e771847 100644 --- a/portal/static/js/onelab_slice-resource-view.js +++ b/portal/static/js/onelab_slice-resource-view.js @@ -27,6 +27,8 @@ $(document).ready(function() { }); + // Unused "List of testbeds" tab + /* $.get("/rest/network", function(data) { var list = '
Testbeds
'; for(i=0; i