result Promise
Promise
a jQuery promise instance, which can be used for callbacks, or passed to jQuery.when. The jQuery Deferred object resolves to:
-
done()
- when user has pressed the "OK" button and the data passed to the callback is the inputted text; -
fail()
- when user has pressed the "Cancel" button and the data passed to the callback is the inputted text.
Example
<div id="prompt"></div>
<script>
$("#prompt").kendoPrompt({
content: "Prompt text",
value: "Default input text",
messages:{
okText: "OK"
}
}).data("kendoPrompt").result.done(function(data){
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log("User accepted with text: " + data);
})
.fail(function(data){
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log("User rejected with text: " + data);
});
</script>