Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.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
如何在angularjs中聚焦表格中的文本框?_Angularjs_Asp.net Mvc_Entity Framework_Asp.net Web Api - Fatal编程技术网

如何在angularjs中聚焦表格中的文本框?

如何在angularjs中聚焦表格中的文本框?,angularjs,asp.net-mvc,entity-framework,asp.net-web-api,Angularjs,Asp.net Mvc,Entity Framework,Asp.net Web Api,角度js代码:ng onchange代码 html表格代码 {{item.ProductName} {{item.ProductRate} {{item.TotalAmount} 总计{{gridproducts[0].TotalBill}}总计项目25 $scope.txtqty = function (item) { var id = item.Id; $http.put("/api/Products/txtqty/" + id, item).then(

角度js代码:ng onchange代码

html表格代码


{{item.ProductName}
{{item.ProductRate}
{{item.TotalAmount}
总计{{gridproducts[0].TotalBill}}总计项目25
 $scope.txtqty = function (item) {
        var id = item.Id;
        $http.put("/api/Products/txtqty/" + id, item).then(function (response) {
            $scope.gridproducts = response.data;
        })
    }
 <tbody>
                                                    <tr ng-repeat="item in gridproducts">
                                                        <td ng-click="griddelete(item.Id)"><a class="delete"><i class="fa fa-times-circle-o"></i></a></td>
                                                        <td class="name">{{item.ProductName}}</td>
                                                        <td>{{item.ProductRate}}</td>
                                                        <td><input class="form-control qty" type="text" style="width:50px" ng-change="txtqty(item)" ng-model="item.ProductQty" value="{{item.ProductQty}}"></td>
                                                        <td>{{item.TotalAmount}}</td>
                                                    </tr>
                                                    <tr></tr>
                                                <tfoot><tr><th colspan="2"></th><th colspan="2"><b>Total</b></th><th><b>{{gridproducts[0].TotalBill}}</b></th></tr><tr><th colspan="2"><b></b></th><th colspan="2"><b>Total Items</b></th><th><b>25</b></th></tr></tfoot>
                                            </table>