智能表中的行选择不起作用

时间:2017-03-30 08:29:48

标签: angularjs smart-table

我无法使用智能表选择行。我添加了JSON和HTML。 用于打开模态窗口的代码

$ scope.getSerialData = function(){

    var serialNo ='700001117961';// $scope.asupFormData.asup_serial_no;
    $http({
                method: 'GET',
                url: getAsupSerialData+serialNo+'/',            
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded'
                } // set the headers so angular passing info as form data (not request payload)
            }).success(function(data) {
                $scope.rowCollection1 = JSON.parse(data);
                $scope.rowCollection = $scope.rowCollection1.result;

                console.log($scope.rowCollection)
            }).error(function(data){

            });

    $scope.close = function() {
        uibModalInstance.dismiss('cancel');
    };  

    $scope.saveForms = function(){      

    uibModalInstance.dismiss('cancel');
    }

    var uibModalInstance = $uibModal.open({
        templateUrl: 'asupsearchform.html/',            
        scope: $scope,

        controller:'MainCtrl',
        windowClass: 'device-modal-window'
    });
}   

rowCollection

[["2017032517580346","HA Group Notification (WEEKLY_LOG) NOTICE"],
["2017031818200373","HA Group Notification (WEEKLY_LOG) NOTICE"],
["2017031818200372","HA Group Notification (WEEKLY_LOG) NOTICE"]]

$ scope.getSerialData从某个链接调用,打开一个模态窗口
HTML

<table st-table="rowCollection" class="table" >
<thead>
<tr>
    <th st-sort="firstName">ID</th>
    <th st-sort="lastName">Title</th>   
</tr>
</thead>
<tbody>
<tr  st-select-row="row" st-select-mode="multiple" ng-repeat="row in rowCollection" ng-click="doSomeStuffToSelected(row)">
    <td>{{row[0]}}</td>
    <td>{{row[2]}}</td>


</tr>
</tbody>
</table>

请帮助。静态代码选择工作正常。当我在modalwindow

下使用它时,就会发生这种情况

1 个答案:

答案 0 :(得分:2)

您需要为app.post('/AddNewuser', function (req, res) { console.log(req.body); db.Users.insert(req.body, function (err, docs) { res.json(docs); }); });

定义样式
.st-selected

同样在<style> .st-selected{ background: #216eff !important; color: white !important; } </style> 值中,子阵列中的位置为0和1,而您使用位置0和2

rowCollection

以下是 WORKING DEMO

编辑: Demo 使用模式