Using a Modal Window with KendoUI inside of Angula

2019-07-30 12:49发布

Does anyone have any experience using KendoUI's window with AngularJS?

I'm currently using Angular-Kendo but I'm not entirely sure hot to cleanly use the window. Or if there is any other solutions for presenting a modal dialog and filling it with a form loaded via a partial I'm open to that as well.

My current code looks something like this:

HTML:

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

JS:

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

But I hate this, and it feels wrong for how I'm doing everything else. Any thoughts on a better way?

3条回答
Animai°情兽
2楼-- · 2019-07-30 13:03

@anise thanks for ur information

finally i also resolve the issue.

Controller

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

View

 <div kendo-window="window" k-visible="false" k-modal="true">   </div> 
查看更多
别忘想泡老子
3楼-- · 2019-07-30 13:12
forever°为你锁心
4楼-- · 2019-07-30 13:20

Check out this library

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
                    });
查看更多
登录 后发表回答