gpt4 book ai didi

extjs - Pimcore Extjs 如何覆盖不同插件中的相同方法

转载 作者:行者123 更新时间:2023-12-01 04:57:04 28 4
gpt4 key购买 nike

我正在使用 pimcore 3。当发布任何以前的版本时,我需要对不同的类对象进行自定义验证。我需要在不同的插件上实现不同的验证。问题是,如果我在多个插件中覆盖相同的方法,则只有一种覆盖方法有效。这就是我覆盖该方法的方式:

Ext.override(pimcore.object.versions, {
publishVersion: function (index, grid) {
//Code goes here
}
});

我是 extjs 和 pimcore 的新手,任何帮助将不胜感激。
提前致谢。

最佳答案

I Actually dont know the Extjs Version of doing such Thing.but im quite sure u can get around it with Monkey patching.by overidding the function where u wrap your plugin functions to itexample plugin code:
var old=pimcore.object.versions.prototype.publishVersion;
pimcore.object.versions.prototype.publishVersion = function(index,grid) {
do your stuff
return old(index,grid);
}

关于extjs - Pimcore Extjs 如何覆盖不同插件中的相同方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36395141/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com