Skip to content

Instantly share code, notes, and snippets.

@A2H111
Created April 8, 2017 04:39
Show Gist options
  • Save A2H111/28d36aa6dda74309599c64fcbafbd33e to your computer and use it in GitHub Desktop.
Save A2H111/28d36aa6dda74309599c64fcbafbd33e to your computer and use it in GitHub Desktop.
columnDefs: [
{
name: "CustomerID", displayName: "Customer ID", field: "CustomerID",
cellTemplate: '<div ng-if="!row.entity.editrow">{{COL_FIELD}}</div><div ng-if="row.entity.editrow"><input type="text" style="height:30px" ng-model="MODEL_COL_FIELD"</div>', width: 80
},
{
name: "CompanyName", displayName: "Company Name", field: "CompanyName",
cellTemplate: '<div ng-if="!row.entity.editrow">{{COL_FIELD}}</div><div ng-if="row.entity.editrow"><input type="text" style="height:30px" ng-model="MODEL_COL_FIELD"</div>', width: 200
},
{
name: "ContactName", displayName: "Contact Name", field: "ContactName",
cellTemplate: '<div ng-if="!row.entity.editrow">{{COL_FIELD}}</div><div ng-if="row.entity.editrow"><input type="text" style="height:30px" ng-model="MODEL_COL_FIELD"</div>', width: 140
},
{
name: "ContactTitle", displayName: "Contact Title", field: "ContactTitle",
cellTemplate: '<div ng-if="!row.entity.editrow">{{COL_FIELD}}</div><div ng-if="row.entity.editrow"><input type="text" style="height:30px" ng-model="MODEL_COL_FIELD"</div>', width: 140
},
{
name: 'Actions', field: 'edit', enableFiltering: false, enableSorting: false,
cellTemplate: '<div><button ng-show="!row.entity.editrow" class="btn primary" ng-click="grid.appScope.edit(row.entity)"><i class="fa fa-edit"></i></button>' + //Edit Button
'<button ng-show="row.entity.editrow" class="btn primary" ng-click="grid.appScope.saveRow(row.entity)"><i class="fa fa-floppy-o"></i></button>' +//Save Button
'<button ng-show="row.entity.editrow" class="btn primary" ng-click="grid.appScope.cancelEdit(row.entity)"><i class="fa fa-times"></i></button>' + //Cancel Button
'</div>', width: 100
}
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment