Commit 55da2eac918f1b51c7c913eabae3ab634fad57ed

Authored by Benjamin Renard
1 parent a061cfac

Fix another bug with TT manager (#6246) + Fix clear filters (#6162)

Showing 1 changed file with 38 additions and 25 deletions   Show diff stats
js/app/views/TimeTableUI.js
... ... @@ -88,6 +88,7 @@ Ext.define('amdaUI.TimeTableUI', {
88 88  
89 89 // clear filters
90 90 me.TTGrid.getStore().clearFilter(true);
  91 + me.TTGrid.filters.clearFilters();
91 92  
92 93 //clear sort
93 94 me.TTGrid.getStore().sorters.clear();
... ... @@ -240,13 +241,15 @@ Ext.define('amdaUI.TimeTableUI', {
240 241 this.TTGrid.getSelectionModel().deselectAll();
241 242 AmdaAction.addTTCacheInterval({'start' : start, 'stop' : stop, 'index' : row},function (result, e) {
242 243 this.status = result.status;
243   - this.TTGrid.getStore().reload({
244   - callback : function(records, options, success) {
245   - me.TTGrid.getView().bufferedRenderer.scrollTo(row, false, function() {
246   - me.TTGrid.getView().select(row);
247   - }, me);
248   - }
249   - });
  244 + if (!this.TTGrid.getStore().loading) {
  245 + this.TTGrid.getStore().reload({
  246 + callback : function(records, options, success) {
  247 + me.TTGrid.getView().bufferedRenderer.scrollTo(row, false, function() {
  248 + me.TTGrid.getView().select(row);
  249 + }, me);
  250 + }
  251 + });
  252 + }
250 253 }, this);
251 254 },
252 255  
... ... @@ -418,15 +421,20 @@ Ext.define('amdaUI.TimeTableUI', {
418 421 var ttModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.tt.id);
419 422 if (ttModule)
420 423 ttModule.getUiContent().status = result.status;
421   - context.grid.getSelectionModel().deselectAll();
422   - context.store.reload({
423   - callback : function(records, options, success) {
424   - context.view.bufferedRenderer.scrollTo(context.rowIdx, true, function() {
425   - me.fireEvent('edit', me, context);
426   - me.editing = false;
427   - }, me);
428   - }
429   - });
  424 + if (!context.store.loading) {
  425 + context.grid.getSelectionModel().deselectAll();
  426 + context.store.reload({
  427 + callback : function(records, options, success) {
  428 + context.view.bufferedRenderer.scrollTo(context.rowIdx, true, function() {
  429 + me.fireEvent('edit', me, context);
  430 + me.editing = false;
  431 + }, me);
  432 + }
  433 + });
  434 + }
  435 + else {
  436 + me.editing = false;
  437 + }
430 438 }, this);
431 439 }
432 440 else
... ... @@ -569,14 +577,16 @@ Ext.define('amdaUI.TimeTableUI', {
569 577 var me = this;
570 578 AmdaAction.addTTCacheInterval({'index' : row}, function (result, e) {
571 579 this.status = result.status;
572   - this.TTGrid.getStore().reload({
573   - callback : function(records, options, success) {
574   - me.TTGrid.getView().bufferedRenderer.scrollTo(row, false, function() {
575   - me.TTGrid.getView().select(row);
576   - cellEditing.startEditByPosition({row: row, column: 1});
577   - }, me);
578   - }
579   - });
  580 + if (!this.TTGrid.getStore().loading) {
  581 + this.TTGrid.getStore().reload({
  582 + callback : function(records, options, success) {
  583 + me.TTGrid.getView().bufferedRenderer.scrollTo(row, false, function() {
  584 + me.TTGrid.getView().select(row);
  585 + cellEditing.startEditByPosition({row: row, column: 1});
  586 + }, me);
  587 + }
  588 + });
  589 + }
580 590 }, this);
581 591 }
582 592 }, {
... ... @@ -591,7 +601,9 @@ Ext.define('amdaUI.TimeTableUI', {
591 601 this.TTGrid.getSelectionModel().deselectAll();
592 602 AmdaAction.removeTTCacheIntervalFromId(rowId, false, function (result, e) {
593 603 this.status = result.status;
594   - this.TTGrid.getStore().reload();
  604 + if (!this.TTGrid.getStore().loading) {
  605 + this.TTGrid.getStore().reload();
  606 + }
595 607 }, this);
596 608 }
597 609 }
... ... @@ -602,6 +614,7 @@ Ext.define('amdaUI.TimeTableUI', {
602 614 scope: this,
603 615 handler: function () {
604 616 this.TTGrid.getStore().clearFilter(true);
  617 + this.TTGrid.filters.clearFilters();
605 618 }
606 619 }
607 620 ]
... ...