当我集成2个模块时,我会得到以下错误:
未执行!:$数据承诺。然后
我花了两天的时间来处理它。在本地服务器上它可以工作,但在我的本地系统上,这个错误即将到来。
这是我的代码:
function getSelectedGridData(viewId,filterId,groupId){
// Declaration of variables
var resultArray=[];
var viewFieldArray=[];
var headerArray=[];
var headerString="";
var groupString="";
var innerFilterString="";
var outerFilterString="";
var swapFilter="";
offlinedb.view.toArray(function (View) {
................some code...........
// Fetch data from table 'document_header' and convert entity set into array
offlinedb.document_headers.toArray(function (header){
......some code............
});
}).then(function (startGroup){
offlinedb.grouping.toArray(function (Group) {
...some code.....
}).then(function (startFilter){
offlinedb.filters.toArray(function (Filter) {
..some code............
sqlitedb.transaction(function (sqliteTransation) {
...some code.....
});
});
});
});
}
我的错误是:
Not implemented!: $data.Promise.then
Exception {name: "Not implemented!", message: "$data.Promise.then", data: undefined, _getStackTrace: function}
jaydata.js:1880
Guard.raise jaydata.js:1880
$data.Class.define.then jaydata.js:9239
getSelectedGridData common.js:72
(anonymous function) common.js:348
Uncaught Not implemented!: $data.Promise.then
您需要一个promise库、jquery或q
按照显示的顺序排列,就可以工作了
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script src="http://include.jaydata.org/jaydata.js"></script>