..
[unfold.git] / plugins / lists / simplelist.js
index 6fdb4c3..147bd44 100644 (file)
@@ -10,7 +10,7 @@
 (function($){
 
     var debug=false;
-    //debug=true
+    // debug=true
 
     $.fn.SimpleList = function( method ) {
         /* Method calling logic */
@@ -34,7 +34,7 @@
                    /* passing $this as 2nd arg: callbacks will retrieve $this as e.data */
                    $.subscribe(channel, $this, update_plugin);
                    if (debug) window.console.log('subscribing to ' + channel);
-                   $this.data('SimpleList', {options: options});
+                   $this.data('SimpleList', options);
                }
            });
        },
        $plugindiv.closest('.need-spin').spin(false);
 
         if (rows.length == 0) {
-           if (use_datatables) datatables_set_message ("No result");
-           else                regular_set_message ("No result");
+           if (use_datatables) datatables_set_message ($table, $tbody, myslice_warning("No result"));
+           else                regular_set_message ($table, $tbody, myslice_warning("No result"));
             return;
         }
         if (typeof rows[0].error != 'undefined') {
            var error="ERROR: " + rows[0].error;
-           if (use_datatables) datatables_set_message (error);
-           else                regular_set_message (error);
+           if (use_datatables) datatables_set_message ($table, $tbody, myslice_error(error));
+           else                regular_set_message ($table, $tbody, myslice_error(error));
             return;
         }
-        var options = $plugindiv.data().SimpleList.options;
+        var options = $plugindiv.data().SimpleList;
        if (use_datatables)     datatables_update_table ($table,$tbody,rows,options.key);
        else                    regular_update_table ($table,$tbody,rows,options.key);