有没有人有在AngularJS中使用KendoUI的窗口的经验?
我目前正在使用Angular-Kendo,但我不能完全确定是否能干净地使用这个窗口。或者,如果有任何其他解决方案来呈现模式对话框并使用通过部分加载的表单填充它,我也愿意这样做。
我当前的代码如下所示:
HTML:
<div kendo-window id="addWindow" ng-hidden></div>JS:
$scope.addSection = function() {
$("#addWindow").data("kendoWindow").open();
return false;
};但我讨厌这样,而且我做其他事情的方式也让我感觉不对劲。有什么更好的办法吗?
发布于 2013-06-26 05:05:26
看看这篇博文:
http://www.kendoui.com/blogs/teamblog/posts/13-06-24/announcing-angular-kendo-ui.aspx?utm_content=bufferbbe83&utm_source=buffer&utm_medium=twitter&utm_campaign=Buffer
他们重写了Angular-Kendo,并提供了一个使用窗口的干净方法的示例。
发布于 2015-05-26 15:43:04
@anise感谢您的信息
最后,我也解决了这个问题。
控制器
$scope.window;
$scope.OpenWindow= function() // custom function on click
{
$scope.DlgOptions = {
width: 550,
height: 400,
visible: false,
actions: [
"Maximize",
"Close"
]
};
$scope.window.setOptions($scope.DlgOptions);
$scope.window.center(); // open dailog in center of screen
$scope.window.open();
};视图
<div kendo-window="window" k-visible="false" k-modal="true"> </div> 发布于 2015-12-03 00:47:54
检出此库
https://github.com/kjartanvalur/angular-kendo-window
var windowInstance = $kWindow.open({
options:{
modal: true,
title: "Window title",
width: 400,
},
templateUrl: 'modal1.html',
controller: 'modalController',
resolve: {
parameter1: function () {
return "Test...";
}
}
});
windowInstance.result.then(function (result) {
// Here you can get result from the window
});https://stackoverflow.com/questions/17205046
复制相似问题