git://git.onelab.eu
/
myslice.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
plugins: supporting columns adding/removing + passed query instead of uuid as parameters
[myslice.git]
/
plugins
/
query_editor
/
query_editor.js
diff --git
a/plugins/query_editor/query_editor.js
b/plugins/query_editor/query_editor.js
index
3bc3d8b
..
7514b4a
100644
(file)
--- a/
plugins/query_editor/query_editor.js
+++ b/
plugins/query_editor/query_editor.js
@@
-47,6
+47,9
@@
var plugin = new QueryEditor(options);
$this.data('Manifold', plugin);
var plugin = new QueryEditor(options);
$this.data('Manifold', plugin);
+ $this.set_query_handler(options.query_uuid, plugin.query_handler);
+ $this.set_record_handler(options.query_uuid, plugin.record_handler);
+
}); // this.each
}, // init
}); // this.each
}, // init
@@
-149,7
+152,7
@@
});
jQuery('.queryeditor-check').click(function() {
});
jQuery('.queryeditor-check').click(function() {
- manifold.raise_event(object.options.query_uuid, this.checked?
SET_ADD:SET
_REMOVED, this.value);
+ manifold.raise_event(object.options.query_uuid, this.checked?
FIELD_ADDED:FIELD
_REMOVED, this.value);
/*
var column = this.id.substring(6);
query = data.current_query;
/*
var column = this.id.substring(6);
query = data.current_query;
@@
-341,24
+344,12
@@
// elements in set
switch(event_type) {
case NEW_RECORD:
// elements in set
switch(event_type) {
case NEW_RECORD:
- /* NOTE in fact we are doing a join here */
- if (object.received_all)
- // update checkbox for record
- object.set_checkbox(record);
- else
- // store for later update of checkboxes
- object.in_set_buffer.push(record);
break;
case CLEAR_RECORDS:
break;
case CLEAR_RECORDS:
- // nothing to do here
break;
case IN_PROGRESS:
break;
case IN_PROGRESS:
- manifold.spin($(this));
break;
case DONE:
break;
case DONE:
- if (object.received_all)
- manifold.spin($(this), false);
- object.received_set = true;
break;
}
};
break;
}
};
@@
-401,11
+392,12
@@
// Fields
/* Hide/unhide columns to match added/removed fields */
// Fields
/* Hide/unhide columns to match added/removed fields */
+ // XXX WRONG IDENTIFIERS
case FIELD_ADDED:
case FIELD_ADDED:
-
$('#check_' + data).attr('checked', true
);
+
object.check(data
);
break;
case FIELD_REMOVED:
break;
case FIELD_REMOVED:
-
$('#check_' + data).attr('checked', false
);
+
object.uncheck(data
);
break;
case CLEAR_FIELDS:
alert(PLUGIN_NAME + '::clear_fields() not implemented');
break;
case CLEAR_FIELDS:
alert(PLUGIN_NAME + '::clear_fields() not implemented');
@@
-413,6
+405,14
@@
} // switch
} // switch
+ }
+ this.check = function(field)
+ {
+ $('#check_' + field).attr('checked', true);
+ }
+ this.uncheck = function(field)
+ {
+ $('#check_' + field).attr('checked', false);
}
this.fnFormatDetails = function( metaTable, nTr, div_id ) {
var aData = metaTable.fnGetData( nTr );
}
this.fnFormatDetails = function( metaTable, nTr, div_id ) {
var aData = metaTable.fnGetData( nTr );