How to overwrite admin components

Hi
I want to add one extra button into the relational grid box.

In a screenshot i want to add button after the “+” button.

@rushit-credencys Do you want to override only for a single relational field or for multiple?
If you want to do it for single field you can do it in postOpenObject function and for multiple you will need to override the view class of this relation field.

Thanks @neha I have one more issue on same field, like I want to do something when dreg and drop the object into the “categories relational field” (same screenshot) so I am tring with below ExtJs script but it’s not working.

var productComponent = object.edit.dataFields['product'].component;
productComponent.addListener('change', function (obj) {   //---Mycode---  });

change events is not working here with “advance many to many objects relationship”
I have used before with “many to many object relationship” and its working.
Please guide me, if I miss something here.

Well I haven’t done this from a long time but you can try this one.

        var product = object.edit.dataFields['product'];
        product.store.addListener('add', function (store, records) {
            alert("added");
        });
        product.store.addListener('remove', function (store,records) {
            alert("removed");
        });
1 Like