将弹出 window 更改为模板警报 Kendo
Change popup window into template alert Kendo
在这里我想将警报 window 更改为使用警报 Kendo UI 的模板。但是,我之前使用 AJAX 进行警报。
这里是警报window:
我需要帮助来编写 AJAX
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);
}*/
});
});
对此有何看法?
您可以使用 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);
}*/
});
});
样本:
$("#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>
在这里我想将警报 window 更改为使用警报 Kendo UI 的模板。但是,我之前使用 AJAX 进行警报。
这里是警报window:
我需要帮助来编写 AJAX
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);
}*/
});
});
对此有何看法?
您可以使用 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);
}*/
});
});
样本:
$("#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>