BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
<div id="Grid" ej-grid
e-datasource="data"
e-allowpaging="true"
e-allowsorting="true"
e-toolbarsettings="toolbarSettings"
e-editsettings="editSettings"
e-pagesettings="pageSettings"
e-actioncomplete="actionComp"
e-columns="empCols">
</div>
$scope.editSettings = {
allowEditing: true,
allowAdding: true,
allowDeleting: true,
showAddNewRow: true,
rowPosition: "bottom",
editMode: ej.Grid.EditMode.Dialog
};
$scope.actionComp = function (args) {
if (args.requestType === 'save') {
var grid = $("#Grid").ejGrid("instance");
$('#Grid').refreshContent();
}
};
Thank you for your help
<div ng-controller="PhoneListCtrl"> <div id="Grid" ej-grid e-datasource="data" e-allowpaging="true" e-allowsorting="true" e-toolbarsettings="toolbarSettings" e-editsettings="editSettings" e-allowpaging="true" e-actioncomplete="actionComp" e-columns="empCols"> </div> </div> </div> <script> angular.module('listCtrl', ['ejangular', 'ngResource']).factory('Crud', function ($resource) { return $resource('/api/Values/:value', {}, { 'update': { method: 'PUT' }
}); }).controller('PhoneListCtrl', function ($scope) { $scope.empCols = [ { field: "EmployeeID", width: 105, isPrimaryKey:true, textAlign: ej.TextAlign.Right, headerText: "Employee ID" }, { field: "FirstName", headerText: 'First Name', width: 100 }, { field: "LastName", headerText: 'Last Name', width: 110 }, { field: "City", headerText: 'City', width: 90 } ] $scope.data = ej.DataManager({ url: "/api/Values", adaptor: "WebApiAdaptor" }); $scope.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true, showAddNewRow: true, rowPosition: "bottom", editMode: ej.Grid.EditMode.Dialog }; $scope.toolbarSettings = { showToolbar: true, toolbarItems: ["add", "edit", "delete", "update", "cancel"] }; $scope.editHandler = function (args) { Crud.update(args.data) } $scope.addHandler = function (args) { Crud.save(args.data) } $scope.deleteHandler = function (args) { Crud.delete({ id: args.data.EmployeeID }) } }) |
<script> angular.module('listCtrl', ['ejangular']).controller('PhoneListCtrl', function ($scope) { $scope.empCols = [ { field: "EmployeeID", width: 105, isPrimaryKey:true, textAlign: ej.TextAlign.Right, headerText: "Employee ID" }, { field: "FirstName", headerText: 'First Name', width: 100 }, { field: "LastName", headerText: 'Last Name', width: 110 }, { field: "City", headerText: 'City', width: 90 } ] $scope.data = ej.DataManager({ url: "/api/Values", adaptor: "WebApiAdaptor", headers: [{ "UserName": "Admin" }] }); $scope.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true, showAddNewRow: true, rowPosition: "bottom", editMode: ej.Grid.EditMode.Dialog }; $scope.begin = function (args) { this._dataManager.dataSource.headers.push({ "UserName": "Frank" }) } $scope.toolbarSettings = { showToolbar: true, toolbarItems: ["add", "edit", "delete", "update", "cancel"] }; }) |
Thanks for the update.
Please get back to us if you need any further assistance we are happy to assist you.
Regards,
Sellappandi R