Javascript 单击时从行中获取数据并显示到“可编辑”对话框

Javascript 单击时从行中获取数据并显示到“可编辑”对话框,javascript,jquery,angularjs,Javascript,Jquery,Angularjs,我尝试使用Angularjs在单击表中的行时从该行获取数据,并将其显示在可编辑的对话框中。我该怎么做?以下是我目前掌握的情况: <table> <thead> <tr> <th>ID No.</th> <th>Firstname</th>

我尝试使用Angularjs在单击表中的行时从该行获取数据,并将其显示在可编辑的对话框中。我该怎么做?以下是我目前掌握的情况:

<table>
                <thead>
                    <tr>
                        <th>ID No.</th>
                        <th>Firstname</th>
                        <th>Lastname</th>
                        <th>Gender</th>
                        <th>Time</th>
                        <th>Date</th>
                        <th>Type</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="walkin_member in data | filter:searchFilter">
                        <td><a class="click">{{walkin_member.id}}</a></td>
                        <td>{{walkin_member.firstname}}</td>
                        <td>{{walkin_member.lastname}}</td>
                        <td>{{walkin_member.gender}}</td>
                        <td>{{walkin_member.time}}</td>
                        <td>{{walkin_member.datestamp}}</td>
                        <td>{{walkin_member.type}}</td>
                    </tr>
                </tbody>
            </table>

对话框是隐藏的,它只会显示函数是否为triggerd onclick 这是我的javascript

function showDialog(){
        var whitebg = document.getElementById("white-background");
        var dlg = document.getElementById("dlgbox");
        whitebg.style.display = "block";
        dlg.style.display = "block";

        var winWidth = window.innerWidth;

        dlg.style.left = (winWidth/2) - 480/2 + "px";
        dlg.style.top = "150px";


    }

ng click
事件添加到每行的锚标记中,并将当前成员传递给方法

<tr ng-repeat="walkin_member in data | filter:searchFilter">
    <td>
        <a class="click" href="#"
                           ng-click="showInEdit(walkin_member)">{{walkin_member.id}}</a>
      </td>
</tr>
在模型对话框中,您将使用
selectedMember
属性

<div id="dlgbox">
    <div id="dlg-header">Information</div>
    <div id="dlg-body">
      Firstname <input type="text" ng-model="selectedMember.firstname" />
    </div>
</div>

问询处
名字

我的英语不好。谢谢:)你好,谢谢,我有一个问题,因为我有一个onclick在这里显示对话框,它与ng click冲突。我想我需要在这里清除javascript showdialog函数,并将其转换为angularjs.Yea。这是用于角度测量的引导程序。
<tr ng-repeat="walkin_member in data | filter:searchFilter">
    <td>
        <a class="click" href="#"
                           ng-click="showInEdit(walkin_member)">{{walkin_member.id}}</a>
      </td>
</tr>
myApp.controller('loglistController', ['$scope', '$http', function ($scope, $http) {

     $scope.data=[];
     $scope.selectedMember={ firstname:"",lastname:"",gender:"",type:"" }; //new property

     $http.get("../php/loglistajax.php")
          .success(function(data){
                 $scope.data = data;
              })
          .error(function() {
                 $scope.data = "error in fetching data";
             });
     $scope.showInEdit=function(member){
           $scope.selectedMember = member;
     };

}]);
<div id="dlgbox">
    <div id="dlg-header">Information</div>
    <div id="dlg-body">
      Firstname <input type="text" ng-model="selectedMember.firstname" />
    </div>
</div>