Can`t extend qli-group-edit-view

I`m trying to extend the qli-group-edit-view from SDK by using the following custom code:

import customization from 'APP/js/core/customization';
import FilteredListView from 'VIEWS/quotes/qli-group-edit-view';

console.log(FilteredListView);

class customQliGroupEditView extends FilteredListView {

    initialize(options) {
        console.log('ínitialize');
        alert('initialize');
        super.initialize(options);
    }    
};

customization.register(customQliGroupEditView);
 
export default customQliGroupEditView;

console.log(customQliGroupEditView);
console.log(customization);

So far I`ve been only able to log the FilteredListView and stuff, but I can`t extend the initialize method at all. It just ignores anything. I have successfully extended the VIEWS/edit/modules/quotes-edit-container-view by using thie same approach. Is there anything I might be missing regarding this file specifically?

Update: I`m using SDK 49.0.686-1.4.2-2 and not even the quotes-edit-container-view is extendable anymore either. It's not working any longer.

Thank you,

Silvio

  • Hey, Silvio

    So I've just checked our source code regarding your issue

    Currently, out of the box our SDK doesn't allow to register your own custom class to be used instead of defaul qli-group-edit-view. Basically, what happens is that SDK uses default class no matter what, ignoring your own extended class and its registration

    You can see that in file qli-container-view.js:208. 

    The only way for you to use your own class it to directly modify the line I've passed above in SDK source code. But keep in mind that this modification will be overriden and reset to default should you upgrade to next SDK version, and you may have to redo it again

    please consider if we want to address this issue in our SDK to allow for easier QLI customization in future versions

  • Eugene,

    Thank you for answering to my post, but as you might have noticed, I`d updated right before your response the following info: the quotes-edit-container-view is no longer extendable as well for this SDK version. I get the restraint on the extending of qli-group-edit-view, but we were perfectly able to extend the quotes-edit-container-view up to SDK 46. What are we to do if quotes-edit-container-view is not extendable either for SDK 49?

    Silvio

  • I am pretty sure I've tried today and extension and registration of custom quotes-edit-container-view worked well for me.
    Please try again, maybe you had some kind of typo or have forgotten to call register or smth like that?

  • The file had a duplicate somwhere. hahaha Sorry. Thanks anyway.