Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/475.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript UI网格右键单击菜单-使用appScope显示另一个网格_Javascript_Angularjs_User Interface_Grid - Fatal编程技术网

Javascript UI网格右键单击菜单-使用appScope显示另一个网格

Javascript UI网格右键单击菜单-使用appScope显示另一个网格,javascript,angularjs,user-interface,grid,Javascript,Angularjs,User Interface,Grid,我使用的是基于角度的UI网格。我想在行右键单击上显示另一个网格。行的ID字段将使用http.post传递给DB。返回的数据将显示在模式中的另一个网格中。这就是我正在做的 行模板: 行模板:'..' appScopeProvider: appScopeProvider:$scope.myAppScopeProvider $scope.myAppScopeProvider = { showMenu: function (row) { v

我使用的是基于角度的UI网格。我想在行右键单击上显示另一个网格。行的ID字段将使用http.post传递给DB。返回的数据将显示在模式中的另一个网格中。这就是我正在做的

行模板: 行模板:'..'

appScopeProvider: appScopeProvider:$scope.myAppScopeProvider

$scope.myAppScopeProvider = {
            showMenu: function (row) {
                    var modalInstance = $modal.open({
                    controller: 'ContextController',
                    templateUrl: 'ngTemplate/ContextMenu.html',
                    resolve: {
                        selectedRow: function () {
                             //getTable(row.entity);
                            return row.entity;
                        }

                    }
                });

                modalInstance.result.then(function (selectedItem) {
                    console.log('modal selected Row: ' + selectedItem);
                }, function () {
                    console.log('Modal dismissed at: ' + new Date());
                });
            },





app.controller('ContextController',
        ['$scope', '$modal', '$modalInstance', '$filter',     '$interval','$http' ,  'selectedRow',
            function ($scope, $modal, $modalInstance, $filter, $interval,     $http,  selectedRow) {

                $scope.selectedRow = selectedRow;

                $scope.rel_details = function () {

                    $scope.nodeName_rel = selectedRow.NodeName;
                    $scope.fromTime_rel = "2015-11-11";
                    $scope.toTime_rel = "2016-12-21";

                    $http.post('../getData', { nodeName: $scope.nodeName_rel, trapType: 'All', startTime: $scope.fromTime_rel, endTime: $scope.toTime_rel })
                    .success(function (data) {
                        console.log(data);
                        $scope.gridOptions1.data = data;

                    });
                    //$scope.selectedRow = null;
                    //$modalInstance.close();
                };
ContextMenu.html:

<script type="text/ng-template" id="ngTemplate/ContextMenu.html">
<div class="modal-header">
         <h4>Context Menu</h4>
    </div>
    <div class="modal-body">
        <button class="btn btn-primary btnCustom"   ng-        click="rel_details()">Grouped Details</button>
        <div id="grid_rel" ui-grid="gridOptions1" class="grid"></div>
 </div>
    <div class="modal-footer">
        <button class="btn btn-primary btnCustom"   ng-click="ok()">OK</button>
        <!--<button class="btn btn-primary btnCustom"  ng-    click="cancel()">Cancel</button>--> 
    </div>

</script>     

上下文菜单
分组详细信息
好啊

我正在从数据库获取数据,但由于范围问题,我想网格不会显示。everywhere类是从数据库中获取数据的,但由于范围问题,网格并没有显示出来。everywhere类是隔离作用域