2013-06-20 21 views
1

有沒有人有使用KendoUI的窗口和AngularJS的經驗?在AngularJS中使用帶有KendoUI的模態窗口

我目前使用Angular-Kendo但我不能完全肯定熱乾淨利落使用窗口。或者,如果有任何其他解決方案來呈現模式對話框,並通過部分加載的表單填充它,我也可以打開它。

我當前的代碼看起來是這樣的:

HTML:

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

JS:

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

可是,我討厭這一點,而且感覺錯了我是如何做的一切其他。任何想法更好的方法?

回答

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

退房這個庫

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