Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2014
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. app.controller('basicsCtrl', ['$scope', function (scope) {
  2. scope.rowCollection = [
  3. {firstName: 'Laurent', lastName: 'Renard', birthDate: new Date('1987-05-21'), balance: 102, email: 'whatever@gmail.com'},
  4. {firstName: 'Blandine', lastName: 'Faivre', birthDate: new Date('1987-04-25'), balance: -2323.22, email: 'oufblandou@gmail.com'},
  5. {firstName: 'Francoise', lastName: 'Frere', birthDate: new Date('1955-08-27'), balance: 42343, email: 'raymondef@gmail.com'}
  6. ];
  7.  
  8. scope.columnCollection = [
  9. {label: 'First Name', map: 'firstName'},
  10. {label: 'same same but different', map: 'firstName'},
  11. {label: 'Last Name', map: 'lastName'}
  12. ];
  13. }]);
  14.  
  15. scope.columnCollection = [
  16. { 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
  17. //{ label: 'Last Name', map: 'LastName' },
  18. { label: 'User Name', map: 'UserName', validationAttrs: 'required' },
  19. { label: 'Password', map: 'Password', noList: true, editType: 'password' },
  20. { label: 'Customer', map: 'CustId', optionsUrl: '/GetCusts', editType: 'radio' },
  21. { 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 :)
  22. { label: 'E-mail', editType: 'email', map: 'Email' },
  23. { label: 'Cell Phone', map: 'Mobilephone', noEdit: true, validationAttrs: 'required' },
  24. { label: 'Locked', map: 'IsLocked', cellTemplate: '<input disabled type="checkbox" name="{{column.map}}" ng-model="dataRow[column.map]">', editType: 'checkbox', noAdd: true }
  25. ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement