我正在尝试运行以下示例:https://www.oracle.com/webfolder/technetwork/jet/jetCookbook.html?component=listView&demo=filterSortListView
我下载了JET-Template-Web-NavBar,并在dashboard.html和js中替换了示例中给出的代码,但抛出错误说
dashboard.js:73 Uncaught (in promise) ReferenceError: ValidationBase is not defined
at new DashboardViewModel (dashboard.js:73)
js文件
define(['ojs/ojcore', 'knockout','appController','ojs/ojmodel', 'ojs/ojvalidation-base', 'ojs/ojknockout',
'ojs/ojlistview', 'ojs/ojgauge', 'ojs/ojbutton', 'ojs/ojcheckboxset', 'ojs/ojselectcombobox', 'ojs/ojpagingcontrol'],
function( oj,ko, data , app , Model) {
function DashboardViewModel() {
var self = this;
rest是完整的示例复制粘贴,并且未对应用程序随附的默认main.js进行任何更改。所有模块似乎都可用(在调试器上都可以使用200)
答案 0 :(得分:1)
您需要将模块作为正确的参数传递给函数。
define(['ojs/ojcore', 'knockout','appController','ojs/ojmodel', 'ojs/ojvalidation-base', 'ojs/ojknockout',
'ojs/ojlistview', 'ojs/ojgauge', 'ojs/ojbutton', 'ojs/ojcheckboxset', 'ojs/ojselectcombobox', 'ojs/ojpagingcontrol'],
function(oj, ko, app, Model, ValidationBase) {
function DashboardViewModel() {
var self = this;