X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fquerytable%2Fstatic%2Fjs%2Fquerytable.js;h=375aa8f3ff160b934eda0881a09fb6564e9d40db;hb=97bbf7ec1d09ef9837b9b2471fdfa8bf8bd4d959;hp=b182a1aaa4057b0b30ad582d6679bcc1692ffce4;hpb=d7e386318945be3df497f1f6b2ed78d00e9f0c37;p=myslice.git diff --git a/plugins/querytable/static/js/querytable.js b/plugins/querytable/static/js/querytable.js index b182a1aa..375aa8f3 100644 --- a/plugins/querytable/static/js/querytable.js +++ b/plugins/querytable/static/js/querytable.js @@ -403,10 +403,15 @@ switch(data.request) { case FIELD_REQUEST_ADD: case FIELD_REQUEST_ADD_RESET: + // update pending number + $("#badge-pending").data('number', $("#badge-pending").data('number') + 1 ); + $("#badge-pending").text($("#badge-pending").data('number')); this.set_checkbox_from_data(data.value, true); break; case FIELD_REQUEST_REMOVE: case FIELD_REQUEST_REMOVE_RESET: + $("#badge-pending").data('number', $("#badge-pending").data('number') - 1 ); + $("#badge-pending").text($("#badge-pending").data('number')); this.set_checkbox_from_data(data.value, false); break; default: @@ -451,18 +456,18 @@ on_all_query_done: function() { - if (debug) messages.debug("1-shot initializing dataTables content with " + this.buffered_lines.length + " lines"); - this.table.fnAddData (this.buffered_lines); - this.buffered_lines=[]; + if (debug) messages.debug("1-shot initializing dataTables content with " + this.buffered_lines.length + " lines"); + this.table.fnAddData (this.buffered_lines); + this.buffered_lines=[]; var self = this; // if we've already received the slice query, we have not been able to set // checkboxes on the fly at that time (dom not yet created) $.each(this.buffered_records_to_check, function(i, record) { - if (debug) messages.debug ("querytable delayed turning on checkbox " + i + " record= " + record); + if (debug) messages.debug ("querytable delayed turning on checkbox " + i + " record= " + record); self.set_checkbox_from_record(record, true); }); - this.buffered_records_to_check = []; + this.buffered_records_to_check = []; this.received_all_query = true; // unspin once we have received both