Procházet zdrojové kódy

HUE-1581 [jobsub] Saving a design clones it

Abraham Elmahrek před 12 roky
rodič
revize
4ef020a
1 změnil soubory, kde provedl 3 přidání a 0 odebrání
  1. 3 0
      apps/jobsub/src/jobsub/templates/designs.mako

+ 3 - 0
apps/jobsub/src/jobsub/templates/designs.mako

@@ -762,6 +762,7 @@ var designTable = $('#designTable').dataTable( designTableOptions );
 /**
 /**
  * Redraw a table after the table has been dynamically updated.
  * Redraw a table after the table has been dynamically updated.
  * This is necessary because KO and datatables don't play well together.
  * This is necessary because KO and datatables don't play well together.
+ * This is useful when datatables doesn't automatically update and no extra rows have been added.
  */
  */
 function redraw() {
 function redraw() {
   designTable.fnDestroy();
   designTable.fnDestroy();
@@ -773,9 +774,11 @@ function redraw() {
  * Reload with datatables.
  * Reload with datatables.
  * Remove datatables, reload, then reinitialize datatables.
  * Remove datatables, reload, then reinitialize datatables.
  * Knockout doesn't work without this.
  * Knockout doesn't work without this.
+ * Clearing the table is necessary so multiple rows will not be added.
  */
  */
 function reload() {
 function reload() {
   $(document).one('load.designs', function() {
   $(document).one('load.designs', function() {
+    designTable.fnClearTable();
     designTable.fnDestroy();
     designTable.fnDestroy();
   });
   });
   designs.load();
   designs.load();