From a0164aed0b9d16a783dc214612aeb2e555d1c68b Mon Sep 17 00:00:00 2001 From: Loic Baron Date: Wed, 16 Oct 2013 15:42:15 +0200 Subject: [PATCH] query_editor plugin fix autocomplete with datatables pagination, search in objects that are not currently displayed, as coded into hazelnut (datatables) plugin - http://trac.myslice.info/ticket/6 --- plugins/query_editor/static/js/query_editor.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/query_editor/static/js/query_editor.js b/plugins/query_editor/static/js/query_editor.js index 7338b69b..17b9bf77 100644 --- a/plugins/query_editor/static/js/query_editor.js +++ b/plugins/query_editor/static/js/query_editor.js @@ -92,6 +92,7 @@ // { 'sWidth': '8px', 'aTargets': [ 4 ] } // XXX NB OF COLS // ] }); + this.table = metaTable; // Actions on the newly added fields this.elmt('table tbody td span').on('click', function() { @@ -279,7 +280,10 @@ jQuery.each(availableTags, function(key, value){ value.sort(); - jQuery("#"+domid+"__field__"+key).autocomplete({ + // using dataTables's $ to search also in nodes that are not currently displayed + var element = self.table.$("#"+domid+"__field__"+key); + + element.autocomplete({ source: value, selectFirst: true, minLength: 0, // allows to browse items with no value typed in -- 2.43.0