0
votes

I am very new to Angular js, in my project we are using UI grid to show List of records. we have requirement Add new record into Grid(uigrid),

We are also lookinh into below link also. http://ui-grid.info/

Any one help me out how to achieve above requirement

thanks,

2

2 Answers

0
votes

You can just add an empty record to the data.

$scope.data.push(emptyRecordToBeInserted);
0
votes

You need to write something like

call this function when you want to add new row.

Sample Code

$scope.addData = function() {
    var n = $scope.gridOpts.data.length + 1;
    $scope.gridOpts.data.push({
                "firstName": "New " + n,
                "lastName": "Person " + n,
                "company": "abc",
                "employed": true,
                "gender": "male"
              });
  };

And for editing You can add these properties in you div

<div ui-grid-edit ui-grid-row-edit ></div>