X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fquerytable%2Fstatic%2Fjs%2Fquerytable.js;h=8637e7289514bfb336a72856e3f0a6b9b0bcb813;hb=0bbc8c2d0a8071630df62bf6b953377e9318e09e;hp=ca2c5da2699a8aae6dd41aaa9228173f87f2ce60;hpb=342a0ee5c88219bd359b111fe371386e3104458e;p=myslice.git
diff --git a/plugins/querytable/static/js/querytable.js b/plugins/querytable/static/js/querytable.js
index ca2c5da2..8637e728 100644
--- a/plugins/querytable/static/js/querytable.js
+++ b/plugins/querytable/static/js/querytable.js
@@ -11,8 +11,8 @@
var QueryTable = Plugin.extend({
- init: function(options, element)
- {
+ init: function(options, element) {
+ this.classname="querytable";
this._super(options, element);
/* Member variables */
@@ -207,8 +207,20 @@
else
line.push(record['hostname']);
- } else if (colnames[j] == 'hrn' && typeof(record) != 'undefined') {
- line.push(' '+record['hrn']);
+ } else if (colnames[j] == this.init_key && typeof(record) != 'undefined') {
+ obj = this.object
+ o = obj.split(':');
+ if(o.length>1){
+ obj = o[1];
+ }else{
+ obj = o[0];
+ }
+ /* XXX TODO: Remove this and have something consistant */
+ if(obj=='resource'){
+ line.push(' '+record[this.init_key]);
+ }else{
+ line.push(' '+record[this.init_key]);
+ }
} else {
if (record[colnames[j]])
line.push(record[colnames[j]]);
@@ -288,7 +300,7 @@
{
// Remove corresponding filters
this.filters = $.grep(this.filters, function(x) {
- return x != filter;
+ return x == filter;
});
this.redraw_table();
},
@@ -403,7 +415,7 @@
switch(data.request) {
case FIELD_REQUEST_ADD:
case FIELD_REQUEST_ADD_RESET:
- this.set_checkboxfrom_data(data.value, true);
+ this.set_checkbox_from_data(data.value, true);
break;
case FIELD_REQUEST_REMOVE:
case FIELD_REQUEST_REMOVE_RESET:
@@ -478,6 +490,15 @@
if (op == '=' || op == '==') {
if ( col_value != value || col_value==null || col_value=="" || col_value=="n/a")
ret = false;
+ }else if (op == 'included') {
+ $.each(value, function(i,x) {
+ if(x == col_value){
+ ret = true;
+ return false;
+ }else{
+ ret = false;
+ }
+ });
}else if (op == '!=') {
if ( col_value == value || col_value==null || col_value=="" || col_value=="n/a")
ret = false;