X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fquerytable%2Fstatic%2Fjs%2Fquerytable.js;h=8637e7289514bfb336a72856e3f0a6b9b0bcb813;hb=dcc65257573225bcb6c97038268397745a5e3e6c;hp=19ecd6cc404c3a1775a49ca9b012f347bbf9197c;hpb=1e6ad323ac42147a48450401f49f292e97f91ff4;p=myslice.git diff --git a/plugins/querytable/static/js/querytable.js b/plugins/querytable/static/js/querytable.js index 19ecd6cc..8637e728 100644 --- a/plugins/querytable/static/js/querytable.js +++ b/plugins/querytable/static/js/querytable.js @@ -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;