+ // complexity here is mostly because a datatables-enabled table cannot
+ // be updated in a "normal" way using .html()
+ function update_plugin(e, rows) {
+ // e.data is what we passed in second argument to subscribe
+ // so here it is the jquery object attached to the plugin <div>
+ var $plugindiv=e.data;
+ // locate the <table> element; with datatables in the way,
+ // this might not be a direct son of the div-plugin
+ var $table=$plugindiv.find("table.simplelist").first();
+ // also we may or may not have a header
+ var $tbody=$table.find("tbody.simplelist").first();
+ var use_datatables = $table.hasClass("with-datatables");
+ if (simplelist_debug) console.log($plugindiv.attr('id') + " udt= " + use_datatables);
+
+ // clear the spinning wheel: look up an ancestor that has the need-spin class
+ // do this before we might return
+ $plugindiv.closest('.need-spin').spin(false);