How to hide "This is intentional?" warning in Ext JS 6?

I am currently developing an Ext JS 6 application with some levels of component inheritance where some alias mappings are overridden. Ext JS debug is so friendly that it lets me know every time I do it.

[W] Overriding existing mapping: 'controller.my-controller' From 'MyBase.app.Controller' to 'MySub.app.Controller'. Is this intentional?

      

In my case, this is intentional. The warnings stack up and it gets harder to see the forest for the trees.

  • Is there some way to disable these assertions for only those intent classes?
  • Renaming all my aliases is the best solution?
+3


source to share


2 answers


I would recommend renaming your aliases.

Having two classes with the same alias can lead to problems when trying to instantiate one of them. There is already a great answer to this question for ExtJS 5 with a more detailed explanation. The basic concepts for ExtJs 6 are the same.

As an alias must always be unique (namespaced in it), it is probably a good idea to keep the warnings, just in case you ever miss something ...; -)



If you really want to suppress these warnings, you can still overwrite the Ext.log.warn function with an empty one . As you can see in ext / packages / core / src / class / Inventory.js there seems to be no other way.

Hope this answers your questions!

+3


source


You can easily override the warning by making the "update" parameter set to true when addAlias

called addMapping

.

Ext.Inventory.prototype.addAlias = function(className,alias, update) {
    return this.addMapping(className, alias, this.aliasToName, this.nameToAliases, true);
};

      



https://fiddle.sencha.com/#fiddle/1dec

0


source







All Articles