Create new Row with input in the table when press enter

Asked

Viewed 63 times

-1

I am creating a table using Angularjs and Bootstrap. I would like to know how to add a new line when arriving at the end and press enter key?

inserir a descrição da imagem aqui

1 answer

0


the important thing is to take the code from the enter button and then create the new line inside the array

$scope.addline = function ($event) {
    debugger

    if (event.keyCode == 13) {
        var algo = {};
        for (i = 0; i < $scope.etc.Fields.length; i++) {

            algo["seu array"] = ""

        }

        $scope.myArrayData.push(algo);

    }
}
  • the two keyboard enter keys have the same id ne?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.