Question

Substitution/replacing of modules

This is frustrating:

If we need to extend out of the box modules, is there any other approach other than a replacing module? I get why you'd want to protect some of the out of the box code from being replaced to ensure things work a certain way, but this restriction makes things unnecessarily difficult. Prior to 7.13 (I think that is when this was introduced) there was far more flexibility to be able to customize things.

For my scenario, I need to be able to extend QuickFilterModuleV2 and FixedFilterViewModelV2. Not being able to create a replacing module makes my task impossible to do.

Has anyone created a workaround for this using any other methods, such as function interceptors or any other approach?

Like 0

Like

4 comments

It was strongly not recommended to override base modules before and now the option was just completely restricted. The correct way for changing out-of-the-box modules is by creating new modules without a parent and inheriting via JS

for example

Ext.define("Terrasoft.configuration.MyModule", {

            alternateClassName: "Terrasoft.MyModule",

            extend: "Terrasoft.QuickFilterModule",

 Then replacing client unit schemas where the modules are used and modifying the functionality in order to use the new modules instead of the default ones. 

Please find more information about modules and require.js in google. 

Eugene Podkovka,

Hello Eugene,

Thanks for the response. Much appreciated. 

This is the route that I ended up going. Extending (instead of replacing) can make the task more difficult at times since you might need to modify far more schemas to have them use the extended module (depending on the task). For this particular task, it's not so bad since the QuickFiltersModule is loaded by BaseSectionV2 for all sections and it's easy enough to change that to use by custom extended module. Anyway, for now, all is good, however, I do still miss being able to replace modules (although I do understand why this was changed)

Ryan

Ryan Farley,

How are you? Hope you are doing well. My goal is to add certain custom filters similar to what you propose in another of your posts: https://community.bpmonline.com/questions/programatically-set-periodfilter

Did you extend the functionallity of FixedFilterViewModelV2? 

Thank you!

Regards

Uriel,

I did get pretty close but had to set it aside, for now, to work on other things. However, there are quite a few modules you need to extend to get to where you can get your custom extended view to load, plus there are some private methods that you need to override (methods that are prefixed with "_") which causes a lot of messages in the console. When I get back around to working on it I'd be happy to share the details, assuming I can get it to work.

Ryan

Show all comments