Sqlite (cordova-sqlite-storage plugin) fails Windows Universal (on utils.bind())

Hi all,
Am trying to port my app to windows universal 10 from enyo 2.7 via Visual Studio's Cordova/phonegap support. It fails on the utils.bind() in the method below;
doQuery1: function(inSender, inEvent) {
		searchCodes =  this.$.searchCodes.getValue();
		var mytext = 'select * from OpenCodes where Code LIKE "'+ "%" + searchCodes + "%" +'"';

		this.db.transaction(
		utils.bind(this,(function (transaction) {

		transaction.executeSql(mytext, [], utils.bind(this,this.showDataResponse), utils.bind(this,this.errorHandlerA));
			}))
		);

doQuery2: function(inSender, inEvent) {
                searchCodes =  this.$.searchCodes.getValue();
		var mytext = 'select * from OpenCodes where Code LIKE "'+ "%" + searchCodes + "%" +'"';

               db.transaction(
                function(transaction) {

                      transaction.executeSql(mytext, [], showDataResponse , errorHandlerA);
               });

I have tried to use the equivalent method doQuery2 in enyo but it does not work. doQuery2 works fine with JQuery in Visual studio to show data in tables. I would like to use doQuery2 in enyo 2.7 without the utils.bind, if that is possible.

any help much appreciated


regards

Comments

  • In what way does it fail? Do you receive an error?
  • Hi theryanjduffy

    yes it fails with the following console error:

    SCRIPT5007: Unhandled exception at line 966, column 1 in ms-appx://io.cordova.myappee3dc6/www/dist/index.html
    0x800a138f - JavaScript runtime error: Unable to get property 'transaction' of undefined or null reference

    and highlights this code from the dist/index.html in the www folder

    this.db.transaction(o.bind(this,function(t){t.executeSql(i,[],o.bind(this,this.showDataResponse),o.bind(this,this.errorHandlerA))}))},showDataResponse:function(t,e){for(var i=[],n=0;n<e.rows.length;n++)i[n]=e.rows.item(n)

    kind regards
  • Appears to me the cause isn't utils.bind but perhaps doQuery1 isn't correctly bound. You might confirm it by determining what this points to from within that function (either by the debugger or logging). How is that method called?
Sign In or Register to comment.