我有一个问题,使spreadJS作为AMD模块的工作。虽然这里有文档试图解决如何在AMD中使用wijmo,但它是围绕着使用自己的CDN的:
http://wijmo.com/using-wijmo-with-requirejs/
我查看了传播文档,发现spreadJS被分解为许多模块,如下所示:
http://helpcentral.componentone.com/NetHelp/SpreadHClientUG/webframe.html#modules.html
我尝试过配置requireJS:
requirejs.config({
paths: {
jquery: 'common/js/vendor/jquery-1.9.1',
jquery_ui: 'common/js/vendor/jquery-ui',
spread: 'vendor/spread/plugin/spreadAllMax.1.20133.6'
},
shim: {
spread: {
deps: ['jquery', 'jquery_ui']
}
}
});不幸的是,虽然模块加载正确,但它不能工作。我认为这可能与尝试使用已经包含多个模块的脚本创建一个AMD模块有关,但我对requireJS并不完全满意。
有没有人成功地使用过带有require的spreadJS?
发布于 2013-12-17 20:03:30
SpreadJS在最新版本中支持模块库。因此,您可以根据自己的需要使用SpreadJS的一部分。例如:如果您只使用SpreadJS的一些基本函数,那么您只能添加核心和calc JS引用,而不能添加完整的js。
下面是一个关于使用SpreadJS模块的文档:http://helpcentral.componentone.com/NetHelp/SpreadHClientUG/webframe.html#modules.html
发布于 2014-02-14 04:50:07
我试过了,很管用。除了配置代码之外,您还需要添加以下代码:
require(["jquery", "jquery-ui", "spreadjs"], function () {$("#ss").wijspread();});https://stackoverflow.com/questions/20620654
复制相似问题