X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fquerytable%2Fstatic%2Fjs%2Fquerytable.js;h=9d7bced0716ff2d6f51ceedb3a0ff05c5e1c9fab;hb=f7ed6e816b00fabaf57d2946638a988a3043c3f5;hp=6a553bc9ad25d98b5238e764576d2f49e060560d;hpb=da0d7a82d345bfedd2536d6824f1efb02bfab6b2;p=myslice.git diff --git a/plugins/querytable/static/js/querytable.js b/plugins/querytable/static/js/querytable.js index 6a553bc9..9d7bced0 100644 --- a/plugins/querytable/static/js/querytable.js +++ b/plugins/querytable/static/js/querytable.js @@ -41,8 +41,18 @@ var query = manifold.query_store.find_analyzed_query(this.options.query_uuid); this.method = query.object; - var keys = manifold.metadata.get_key(this.method); - this.key = (keys && keys.length == 1) ? keys[0] : null; + // xxx beware that this.key needs to contain a key that all records will have + // in general query_all will return well populated records, but query + // returns records with only the fields displayed on startup. + this.key = (this.options.id_key); + if (! this.key) { + // if not specified by caller, decide from metadata + var keys = manifold.metadata.get_key(this.method); + this.key = (keys && keys.length == 1) ? keys[0] : null; + } + if (! this.key) messages.warning("querytable.init could not kind valid key"); + + messages.debug("querytable: key="+this.key); /* Setup query and record handlers */ this.listen_query(options.query_uuid); @@ -153,6 +163,7 @@ checkbox_html : function (key, value) { +// if (debug) messages.debug("checkbox_html, value="+value); var result=""; // Prefix id with plugin_uuid result += "