/* Processing hidden_columns */
$.each(this.options.hidden_columns, function(i, field) {
- manifold.raise_event(self.options.query_all_uuid, FIELD_REMOVED, field);
- //self.hide_column(field);
+ //manifold.raise_event(self.options.query_all_uuid, FIELD_REMOVED, field);
+ self.hide_column(field);
});
}, // initialize_table
# XXX We need naming helpers in the python Plugin class also, used in template
class QueryEditor(Plugin):
+ def __init__ (self, query, query_all = None, **settings):
+ Plugin.__init__ (self, **settings)
+ self.query=query
+ self.query_uuid = query.query_uuid
+ self.query_all = query_all
+ self.query_all_uuid = query_all.query_uuid if query_all else None
def template_file(self):
return "query_editor.html"
}
return reqs
- def json_settings_list (self):
- return ['plugin_uuid', 'domid', 'query_uuid']
-
def export_json_settings (self):
return True
'checked': md_field['name'] in self.query.get_select()
})
#return { 'fields': fields, 'hidden_columns': hidden_columns }
+ #return { 'fields': fields , 'query_uuid': self.query_uuid, 'query_all_uuid': self.query_all_uuid }
return { 'fields': fields }
+
+ def json_settings_list (self): return ['plugin_uuid', 'domid', 'query_uuid', 'query_all_uuid', ]
init: function(options, element) {
this._super(options, element);
this.listen_query(options.query_uuid);
+ // this one is the complete list of resources
+ // and will be bound to callbacks like on_all_new_record
+ this.listen_query(options.query_all_uuid, 'all');
+
this.elts('queryeditor-auto-filter').change(this.event_filter_added('='));
this.elts('queryeditor-filter').change(this.event_filter_added('='));
//console.log("Query_Editor: query_done!");
//console.log(this.availableTags);
},
- on_new_record: function(record)
+ /* Autocomplete based on query_all to get all the fields, where query get only the fields selected */
+ on_all_new_record: function(record)
{
- //console.log("Query_Editor: new_record!");
- //console.log(record);
availableTags = this.availableTags;
jQuery.each(record,function(key,value){
value = unfold.get_value(value);
filter_query_editor = QueryEditor(
page = page,
- query = query_resource_all,
+ query = sq_resource,
+ query_all = query_resource_all,
title = "Select Columns",
domid = 'select-columns',
)