I am working on a phonegap app in Icenium, but this question is really about Kendo UI Mobile.
My app has something like this:
"displayText" is bound to a div so that when it changes, the text in the div also changes.
Calling "revealText()" by itself works as expected (i.e. the div updates with displayText and then the sound is played). However, if there are calls made immediately after revealText() (e.g. we make a call to addRowsToAListView()), then there is some lag on the refresh (i.e. the sound will play and *then* the div will update with displayText a second later).
I need the sound to play immediately *after* the displayText has actually updated. I tried binding to the "change" event of the ObservableObject (http://docs.kendoui.com/api/framework/observableobject) and playing the sound in the handler, but it made no difference. Is there a way to bind the the "refresh" of the ObservableObject to ensure that the sound is played after the text of the div has updated with displayText? Or is there some other way to deal with this lag?
Thanks in advance.
My app has something like this:
var myObservable = kendo.observable({
displayText: '',
revealText: function (myText) {
// Do some stuff...
this.set('displayText', myText);
playASound();
}
});
kendo.bind($('#PlayGameContainer'), myObservable);
function playASound() {
// This will play a sound.
}
function addRowsToAListView() {
// This will add some rows to a ListView.
}
Calling "revealText()" by itself works as expected (i.e. the div updates with displayText and then the sound is played). However, if there are calls made immediately after revealText() (e.g. we make a call to addRowsToAListView()), then there is some lag on the refresh (i.e. the sound will play and *then* the div will update with displayText a second later).
I need the sound to play immediately *after* the displayText has actually updated. I tried binding to the "change" event of the ObservableObject (http://docs.kendoui.com/api/framework/observableobject) and playing the sound in the handler, but it made no difference. Is there a way to bind the the "refresh" of the ObservableObject to ensure that the sound is played after the text of the div has updated with displayText? Or is there some other way to deal with this lag?
Thanks in advance.