I want to perform save action on last row tab button click

I want example with angular js and mvc

For example I have three columns on grid 

I am doing tabbing on columns  on last column focus out 
I want to perform save action 

Is it possible ?

If yes, 
Please provide me example with angular js and mvc



1 Reply

MS Madhu Sudhanan P Syncfusion Team August 21, 2015 11:07 AM UTC

Hi Bharat,

Thanks for using Syncfusion products.

Query: “I am doing tabbing on columns  on last column focus out, I want to perform save action”

We can achieve your requirement using the below code snippet. In the below we bound a blur event on the grid element. Delegated event is used since the form elements will be added only on edit operation. The blur event is bound in the grid`s create event and on the focus out of the last form element, we have initiated the grid`s save operation using endEdit method in the event handler.


<div id="grid" ej-grid e-datasource="data" . . . .  e-create="onCreate">

        . . . .
</div>

angular.module("SampleApp", ["ejangular"])

            .controller("SampleController", function ($scope) {

                . . . .

                $scope.onCreate = function () {


                    //Register a blur event

                    this.element.on("blur", "input:last, .e-ddl:last", ej.proxy(function () {


                        //Initiate save operation in grid

                        this.endEdit();


                    }, this));


                };
            });



For your convenience we have created a simple sample with the above code snippet and the same can be find from the below link.

http://jsplayground.syncfusion.com/vimmpeyw

Please refer the below help links for endEdit method of grid.

http://helpjs.syncfusion.com/js/api/ejgrid#methods:endedit

Please let us know if you have any queries.

Regards,
Madhu Sudhanan. P

Loader.
Up arrow icon