Commit 423cb382f22ac6a30fbcfd0c75b81c2f5efb81db
1 parent
82560cb2
Exists in
master
and in
109 other branches
fix folder renaming (phew)
Showing
1 changed file
with
15 additions
and
23 deletions
Show diff stats
js/app/views/ExplorerUI.js
... | ... | @@ -697,16 +697,9 @@ Ext.define('amdaUI.ExplorerUI', { |
697 | 697 | }, |
698 | 698 | field: { |
699 | 699 | validFlag: true, |
700 | - validator : function(value) { | |
701 | - if(value === amdaModel.AmdaNode.NEW_DIR_NAME) { | |
702 | - this.validFlag = 'Field is not modified' | |
703 | - } | |
704 | - return this.validFlag; | |
705 | - }, | |
706 | 700 | listeners: { |
707 | 701 | change : function( field, newValue, oldValue, eOpts ) |
708 | 702 | { |
709 | - console.log('changing...'); | |
710 | 703 | var explModule = myDesktopApp.getLoadedModule(myDesktopApp.dynamicModules.explorer.id); |
711 | 704 | var explUI = explModule.getUiContent(); |
712 | 705 | var activeTreePanel = explUI.getActiveTab(); |
... | ... | @@ -714,23 +707,24 @@ Ext.define('amdaUI.ExplorerUI', { |
714 | 707 | var editedNode = activeTreePanel.getSelectionModel().selected.items[0]; |
715 | 708 | if (editedNode) { |
716 | 709 | editedNode.isValidName(newValue, function (res) { |
717 | - field.validFlag = true; | |
718 | - if (!res) { | |
719 | - field.validFlag = 'Error during object validation'; | |
710 | + var validFlag = true; | |
711 | + if(newValue === amdaModel.AmdaNode.NEW_DIR_NAME) { | |
712 | + validFlag = 'Field is not modified' | |
713 | + } else if (!res) { | |
714 | + validFlag = 'Error during object validation'; | |
720 | 715 | } else if (!res.valid) { |
721 | 716 | if (res.error) { |
722 | - field.validFlag = res.error; | |
717 | + validFlag = res.error; | |
723 | 718 | } else { |
724 | - field.validFlag = 'Invalid object name'; | |
719 | + validFlag = 'Invalid object name'; | |
725 | 720 | } |
726 | 721 | } |
727 | - if (field.validFlag === true) { | |
728 | - console.log('change - valid'); | |
722 | + if (validFlag === true) { | |
729 | 723 | field.lastValid = newValue; |
730 | 724 | } else { |
731 | - console.log('change - not valid:', field.validFlag); | |
732 | - field.markInvalid(field.validFlag); | |
725 | + field.markInvalid(validFlag); | |
733 | 726 | } |
727 | + field.validFlag = validFlag; | |
734 | 728 | }); |
735 | 729 | } |
736 | 730 | } |
... | ... | @@ -742,19 +736,17 @@ Ext.define('amdaUI.ExplorerUI', { |
742 | 736 | plugins: [ new MyTreeEditor({ |
743 | 737 | pluginId: 'treeEditor', |
744 | 738 | listeners: { |
745 | - 'validateedit': function (editor, e) { | |
746 | - var field = e.column.field | |
747 | - console.log('validateedit - field=', field); | |
748 | - if(field.validFlag !== true) { | |
749 | - if(field.lastValid) { | |
750 | - e.record.data[e.field] = field.lastValid; | |
739 | + 'edit': function (editor, e) { | |
740 | + if(e.column.field.validFlag !== true) { | |
741 | + if(e.column.field.lastValid) { | |
742 | + e.record.data[e.field] = e.column.field.lastValid; | |
751 | 743 | } else { |
752 | 744 | e.record.remove(true); |
753 | 745 | } |
754 | 746 | } |
755 | 747 | }, |
756 | 748 | 'beforeedit': function (editor, e) { |
757 | - // e.column.field.fireEvent('change', e.value, e.value); | |
749 | + e.column.field.fireEvent('change', e.column.field, e.value, ''); | |
758 | 750 | } |
759 | 751 | }, |
760 | 752 | scope: this | ... | ... |