- var methods = {
- init : function( options ) {
- return this.each(function(){
- var $this = $(this), data = $this.data('SimpleList');
- /* Subscribe to query updates */
- var channel='/results/' + options.query_uuid + '/changed';
- /* passing $this as 2nd arg: callbacks will retrieve $this as e.data */
- $.subscribe(channel, $this, update_plugin);
- if (debug) window.messages.debug('subscribing to ' + channel);
- $this.data('SimpleList', options);
- });
- },
- destroy : function( ) {
- if (debug) messages.debug("SimpleList.destroy...");
- return this.each(function(){
- var $this = $(this), data = $this.data('SimpleList');
- // xxx not too sure what this is about
- $(window).unbind('SimpleList');
- $this.removeData('SimpleList');
- });
- },
- update : function( content ) {
- if (debug) messages.debug("SimpleList.update...");
- },
- }; // methods
+ init: function (options, element) {
+ this.classname=options.classname;
+ this._super (options, element);
+ this.buffered_records=[];
+ this.listen_query(options.query_uuid);
+ },
+
+ on_query_in_progress: function() {
+ messages.debug("on_query_in_progress");
+ this.spin(true);
+ },
+
+ on_query_done: function() {
+ this._display_table();
+ this.unspin();
+ console.log("query simple list done");
+ console.log(this);
+ console.log(this.buffered_records);
+ },
+
+ on_new_record: function(record) {
+ this.buffered_records.push(record);
+ },