Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I added a default value option to ExtInputDialog #2

Open
tomandersen opened this issue Dec 5, 2013 · 0 comments
Open

I added a default value option to ExtInputDialog #2

tomandersen opened this issue Dec 5, 2013 · 0 comments

Comments

@tomandersen
Copy link

You can have a pre - populated suggestion:

Example code...
function addToOrder(e) {
var theLine = this.dataItem($(e.currentTarget).closest("tr"));
$.when(kendo.ui.ExtInputDialog.show({
title: theLine.title,
input: "1",
message: "Enter the Order Quantity",
required: true,
initialInput: "1" })
).done(function (response) {
if (response.button == "OK") {
console.log(kendo.format("{0} button clicked with input of: {1} for item {2}", response.button, response.input, theLine.no));
} else {
console.log(kendo.format("{0} button clicked", response.button));
}
});

e.preventDefault();
return false;

}

Changes I made to kendo.web.ext.js - added two lines to the bottom of ExtInputDialog
......
modal: true,
visible: false,
message: "",
required: false,
requiredCss: "k-ext-required",
initialInput: "" // added by Tom Andersen
}, options);

            $(document.body).append(kendo.format("<div id='extInputDialog' style='position:relative;'><div style='display:block;margin-left:10px;right-margin:10px;'>{0}</div><div style='display:block;margin-left:10px;margin-right:15px;'><input type='text' class='k-ext-input-dialog-input' style='width:100%;'</input></div></div>", options.message));
            dialog = $("#extInputDialog").kendoExtDialog(options).data("kendoExtDialog");
            $("#extInputDialog").parent().find("div.k-window-titlebar div.k-window-actions").empty();
            $("#extInputDialog .k-ext-input-dialog-input").val(options.initialInput); // added by Tom Andersen
            dialog.center().open();

......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant