renamed views.py in views/__init__.py
authorJordan Augé <jordan.auge@lip6.fr>
Thu, 19 Jun 2014 13:31:13 +0000 (15:31 +0200)
committerJordan Augé <jordan.auge@lip6.fr>
Thu, 19 Jun 2014 13:31:13 +0000 (15:31 +0200)
plugins/querytable/static/js/querytable.js
portal/static/js/onelab_slice-resource-view.js
portal/views/__init__.py [moved from portal/views.py with 100% similarity]

index 97fa4b4..c541141 100644 (file)
                 // 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
                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)
index 1f997d0..7e77184 100644 (file)
@@ -27,6 +27,8 @@ $(document).ready(function() {
        
     });
     
+    // Unused "List of testbeds" tab
+    /*
     $.get("/rest/network", function(data) {
                var list = '<div class="list-group-item sl-platform"><span class="list-group-item-heading">Testbeds</span></div>';
                for(i=0; i<data.length;i++) {
@@ -36,7 +38,8 @@ $(document).ready(function() {
        }).done(function() {
                
        });
-       
+       */
+
        $('button#ApplyPendind').click(function() {
                myslice.apply();
                // $.each(myslice.pending, function(k, p) {
similarity index 100%
rename from portal/views.py
rename to portal/views/__init__.py