RakeshSharma227
RakeshSharma227

Reputation: 381

WL.JSONStore is undefined error in IBM mobilefirst

I am getting WL.JSONStore is undefined error in mobile browser simulator while I am trying to use JSONStore in my mobile application.I am using IBM mobilefirst (version 8.0.0-2017091111). enter image description here

function wlCommonInit(){

WL.JSONStore.init(collections, options).then(function () {
     alert("intialized successfully");

    }).fail(function (errorObject) {
        alert("failed to initialize collection\n"+ JSON.stringify(errorObject));
    });   

document.getElementById("btn_submit").addEventListener("click", onSubmit, false);

}

function onSubmit(){
var collectionName="people";
var data={firstName:$('#first').val(),middleName:$('#middle').val(),lastName:$('#last').val()};
WL.JSONStore.get(collectionName).add(data, options).then(function () {
   alert("added data successfully");
}).fail(function (error) {

});
}

Upvotes: 0

Views: 505

Answers (2)

manjunath kallannavar
manjunath kallannavar

Reputation: 606

Could you specify which version of 'cordova-plugin-mfp-jsonstore' your app is using (run command 'cordova plugin ls').

Did you follow this tutorial Link

Upvotes: 0

Related Questions