Hi Bharat,
Thanks for using Syncfusion products.
Query: “while performing validation If I
am getting error I want to focus on first row and first column of grid of textbox which is open row”
We can achieve this requirement by registering a click event to the grid. Since the Jquery validation will perform out of box of the grid, we need to set the focus to the first element in the click handler registered, when the validation failed.
Please refer the below truncated code example.
<div id="grid" ej-grid e-datasource="data" . . . . e-create="onCreate">
. . . .
</div>
angular.module("SampleApp", ["ejangular"])
.controller("SampleController", function ($scope) {
. . . .
$scope.onCreate = function () {
this.element.on("click.ejgrid", ".e-rowcell,.e-tooltxt", ej.proxy(function (e) {
//Check for edit state and prevent click on edit element.
if (this.model.isEdit && $(e.currentTarget).closest("form").length == 0) {
$("#gridEditForm input")[0].focus();
}
}, this));
};
});
|
For your convenience we have created a grid sample with above code and the same can be referred from the below link.
http://jsplayground.syncfusion.com/oeyk3xqr
Please let us know if you have any query.
Regards,
Madhu Sudhanan. P