Issue with Bind in 2.7

Hi all,

Have used the code below successfully in 2.5 to work with SQlite databases, but in 2.7 I get the following error. "TypeError: 'undefined' is not a function". Webstorm suggests "require call is missing" on enyo.bind.

where is it located?. I used 'enyo init template=onyx-app for my project'
thanks


doQuery: function(inSender, inEvent) {
//dataValue3 = "Boots";

//var mytext = 'SELECT name as Account, Balance FROM sqlite_master, "' + dataValue3 +
// '" WHERE sqlite_master.name = "' + dataValue3 + '".Account AND name NOT LIKE "%WebKit%" ORDER BY name';


this.db.transaction(
enyo.bind(this,(function (transaction) {
transaction.executeSql(mytext, [], enyo.bind(this,this.showDataResponse), enyo.bind(this,this.errorHandler));
}))
);
},

Comments

  • There isn't a global enyo namespace, at least in the way there was in 2.5. Everything has to be require()'d. bind() is included in enyo/utils.
    var utils = require('enyo/utils');
    utils.bind(this function () {});
  • Hi theryanjduffy,

    Thank you very much for the pointer. Much appreciated.
Sign In or Register to comment.