使用模态窗口与KendoUI AngularJS内(Using a Modal Window wit

2019-10-18 07:02发布

有没有人有使用KendoUI与AngularJS窗口的经验吗?

我目前使用角剑道 ,但我不能完全肯定热干净利落使用窗口。 或者,如果有是呈现一个模式对话框,并填充它通过部分加载的形式,任何其他解决方案,我接受这一点。

我当前的代码看起来是这样的:

HTML:

    <div kendo-window id="addWindow" ng-hidden></div>

JS:

    $scope.addSection = function() {
        $("#addWindow").data("kendoWindow").open();
        return false;
    };

但是,我讨厌这个,感觉不对的,我怎么做的一切。 一个更好的方法有什么想法?

Answer 1:

看看这个博客文章:

http://www.kendoui.c​​om/blogs/teamblog/posts/13-06-24/announcing-angular-kendo-ui.aspx?utm_content=bufferbbe83&utm_source=buffer&utm_medium=twitter&utm_campaign=Buffer

他们重写角剑道,并有使用窗口的清洁方法的例子。



Answer 2:

@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> 


Answer 3:

看看这个库

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
                    });


文章来源: Using a Modal Window with KendoUI inside of AngularJS