Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.controller('basicsCtrl', ['$scope', function (scope) {
- scope.rowCollection = [
- {firstName: 'Laurent', lastName: 'Renard', birthDate: new Date('1987-05-21'), balance: 102, email: 'whatever@gmail.com'},
- {firstName: 'Blandine', lastName: 'Faivre', birthDate: new Date('1987-04-25'), balance: -2323.22, email: 'oufblandou@gmail.com'},
- {firstName: 'Francoise', lastName: 'Frere', birthDate: new Date('1955-08-27'), balance: 42343, email: 'raymondef@gmail.com'}
- ];
- scope.columnCollection = [
- {label: 'First Name', map: 'firstName'},
- {label: 'same same but different', map: 'firstName'},
- {label: 'Last Name', map: 'lastName'}
- ];
- }]);
- scope.columnCollection = [
- { label: 'Name', map: 'FirstName', validationAttrs: 'required', validationMsgs: '<span class="error" ng-show="smartTableValidForm.FirstName.$error.required">Required!</span>',cellTemplate:'<div class="name"><span>{{dataRow.FirstName +" "+dataRow.LastName}}</span><div>'}, //have whatever template you want and your custom css
- //{ label: 'Last Name', map: 'LastName' },
- { label: 'User Name', map: 'UserName', validationAttrs: 'required' },
- { label: 'Password', map: 'Password', noList: true, editType: 'password' },
- { label: 'Customer', map: 'CustId', optionsUrl: '/GetCusts', editType: 'radio' },
- { label: 'Role', map: 'RoleId', optionsUrl: '/GetRoles', editType: 'select', defaultTemplate: '<option value="" ng-hide="dataRow[column.map]">---</option>', validationAttrs: 'required', validationMsgs: '<span class="error" ng-show="smartTableValidForm.RoleId.$error.required">Required!</span>' }, // NOTE: small hack which enables defaultTemplate option :)
- { label: 'E-mail', editType: 'email', map: 'Email' },
- { label: 'Cell Phone', map: 'Mobilephone', noEdit: true, validationAttrs: 'required' },
- { label: 'Locked', map: 'IsLocked', cellTemplate: '<input disabled type="checkbox" name="{{column.map}}" ng-model="dataRow[column.map]">', editType: 'checkbox', noAdd: true }
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement