- // clear the spinning wheel
- var $elt = e.data;
- if (simplelist_debug) console.log("about to unspin with elt #" + $elt.attr('id') + " class " + $elt.attr('class'));
- $elt.closest('.need-spin').spin(false);
+
+ // clear the spinning wheel: look up an ancestor that has the need-spin class
+ $this.closest('.need-spin').spin(false);
+
+ // in case we run in datatables mode
+ // xxx this is not working yet
+ // http://datatables.net/forums/discussion/14556/can039t-get-my-table-to-refresh-properly#Item_1
+ // http://live.datatables.net/ufihuc/2/edit#javascript,html
+ // most likely when using datatables we'll have to change the contents using some other way..
+ var datatables_table=$this.find("table.with-datatables");
+ if (simplelist_debug) console.log ("running fnDraw() on " + datatables_table.length + " items");
+ // only try this if needed as datatables might not be loaded at all
+ if (datatables_table.length >0) datatables_table.dataTable().fnDraw();
+