从extjs中的子应用程序发送回调

时间:2017-04-11 11:07:14

标签: extjs

如何从子应用程序发送回调?

 Shopware.app.Application.addSubApplication({
        name: 'Shopware.apps.UploadManager',
        layout: 'small',
        eventScope: me,
        selectionMode: true,
        params: {
            uploadId:uploadId,
            number:number,
            position: position,
            orderID: orderID
        },
        callback: my_Function()
    });

2 个答案:

答案 0 :(得分:0)

“my_Function()”这意味着函数调用。

在定义对象时,只需为其分配函数名称“callback:my_Function”

试试这个,

Shopware.app.Application.addSubApplication({
        name: 'Shopware.apps.UploadManager',
        layout: 'small',
        eventScope: me,
        selectionMode: true,
        params: {
            uploadId:uploadId,
            number:number,
            position: position,
            orderID: orderID
        },
        callback: my_Function
    });

答案 1 :(得分:0)

我自己得到了: - ))

我把它放了 var callback = me.subApplication.callback;

在init函数中

,并通过

调用回调
    if (callback) {
        callback.call(this, orderId);
    }