title | page_title | description |
---|---|---|
Prompt |
Configuration, methods and events of Kendo UI Prompt |
How to initialize an Prompt UI widget, configure its properties and open it. |
Represents the Kendo UI Prompt.
Defines the text of the labels that are shown within the prompt dialog. Used primarily for localization.
<div id="prompt"></div>
<script>
$("#prompt").kendoPrompt({
messages:{
okText: "OK",
cancel: "No"
}
}).data("kendoPrompt").open();
</script>
The title of the OK button.
<div id="prompt"></div>
<script>
$("#prompt").kendoPrompt({
messages:{
okText: "OK",
}
}).data("kendoPrompt").open();
</script>
The title of the Cancel button.
<div id="prompt"></div>
<script>
$("#prompt").kendoPrompt({
messages:{
cancel: "No"
}
}).data("kendoPrompt").open();
</script>
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.
<div id="prompt"></div>
<script>
$("#prompt").kendoPrompt({
content: "Prompt text",
value: "Default input text",
messages:{
okText: "OK"
}
}).data("kendoPrompt").result.done(function(data){ console.log("User accepted with text: " + data); }) .fail(function(data){ console.log("User rejected with text: " + data); }); </script>