Wednesday, 15 July 2015

javascript - Ext.Msg.confirm inside function return value -



javascript - Ext.Msg.confirm inside function return value -

i need create function returns (boolean)result when user clicks yes or no. i'm using ext.msg.confirm. below function (testcase).

function returnanswer() { ext.msg.confirm('hardcoded', 'do want hard-coded strings in application?', function(btn) { if (btn === 'yes') { homecoming true; } else { homecoming false; } }); }

in above function "callback" function returns result , not actual function. how can returnanswer function homecoming result?

thanks in advance.

returnanswer should pass callback:

function returnanswer(callback) { ext.msg.confirm('hardcoded', 'do want hard-coded strings in application?', function(btn) { callback.call(this, btn === 'yes'); }); }

javascript extjs

No comments:

Post a Comment