[英]Change popup window into template alert Kendo
Here I want to change alert window into template that using alert Kendo UI. 在这里,我想将警报窗口更改为使用警报Kendo UI的模板。 But , I was using AJAX to do the alert before.
但是,我以前使用AJAX进行警报。
Here the alert window: 这里是警报窗口:
I'm need a help to code it in AJAX 我需要帮助以AJAX进行编码
AJAX PHP
AJAX PHP
//AJAX call for button
$("#primaryTextButton").kendoButton();
var button = $("#primaryTextButton").data("kendoButton");
button.bind("click", function(e) {
var test = $("#dropdown").val()
$.ajax({
url: "../DesignationProgramTemplate/getTemplate.php",
type: "post",
data: {'id':test,'progid':array},
success: function () {
// you will get response from your php page (what you echo or print)
alert('success'); //coding alert
//refresh
//location.reload("http://hq-global.winx.ehors.com:9280/ehors/HumanResource/EmployeeManagement/DesignationProgramTemplate/template.php");
},
/* error: function(jqXHR, textStatus, errorThrown) {
console.log(textStatus, errorThrown);
}*/
});
});
Any opinion on this above? 对此有任何意见吗?
You could use kendo.dialogs
: 您可以使用
kendo.dialogs
:
//AJAX call for button
$("#primaryTextButton").kendoButton();
var button = $("#primaryTextButton").data("kendoButton");
button.bind("click", function(e) {
var test = $("#dropdown").val()
$.ajax({
url: "../DesignationProgramTemplate/getTemplate.php",
type: "post",
data: {
'id': test,
'progid': array
},
success: function() {
// you will get response from your php page (what you echo or print)
kendo.alert('success'); //coding alert
//refresh
//location.reload("http://hq-global.winx.ehors.com:9280/ehors/HumanResource/EmployeeManagement/DesignationProgramTemplate/template.php");
},
/* error: function(jqXHR, textStatus, errorThrown) {
console.log(textStatus, errorThrown);
}*/
});
});
Sample: 样品:
$("#alertBtn").on("click", function() { kendo.alert("This is a Kendo UI Alert message."); }); $("#confirmBtn").on("click", function() { kendo.confirm("Are you sure that you want to proceed?").then(function() { kendo.alert("You chose the Ok action."); }, function() { kendo.alert("You chose to Cancel action."); }); }); $("#promptBtn").on("click", function() { kendo.prompt("Please, enter a arbitrary value:", "any value").then(function(data) { kendo.alert(kendo.format("The value that you entered is '{0}'", data)); }, function() { kendo.alert("Cancel entering value."); }) });
html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.2.619/styles/kendo.common.min.css" /> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.2.619/styles/kendo.uniform.min.css" /> <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.2.619/styles/kendo.uniform.mobile.min.css" /> <script src="https://kendo.cdn.telerik.com/2019.2.619/js/jquery.min.js"></script> <script src="https://kendo.cdn.telerik.com/2019.2.619/js/kendo.all.min.js"></script> <button id="alertBtn" class="k-button">kendo.alert</button> <button id="confirmBtn" class="k-button">kendo.confirm</button> <button id="promptBtn" class="k-button">kendo.prompt</button>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.