123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- angular.module('luticate')
- .controller('TestController', ['$scope', 'luticateAuthUsers',
- function($scope, luticateAuthUsers) {
-
- $scope.luBasicTable = {
- columns: [
- {
- name: "Username",
- width: 3,
- getValue: function (item) {
- return item.Username;
- }
- }, {
- name: "Email",
- width: 3,
- getValue: function (item) {
- return item.Email;
- }
- }, {
- name: "Firstname",
- width: 3,
- getValue: function (item) {
- return item.Firstname;
- }
- }, {
- name: "Lastname",
- width: 3,
- getValue: function (item) {
- return item.Lastname;
- }
- }
- ],
-
- canCheck: function()
- {
- return true;
- },
-
- canClick: function()
- {
- return false;
- },
-
- onItemClicked: function(item)
- {
- console.log(item);
- scope.toggleCheckedItem(item);
- },
-
- onItemChecked: function(item, checked)
- {
- console.log(item, checked);
- },
-
- getLoadPagePromise: function (page, perPage, query, promise)
- {
- return luticateAuthUsers.getAll({page: page, perPage: perPage, query: query}, promise);
- }
- };
-
- $scope.luEditTable = {
- columns: [
- {
- name: "Username",
- width: 3,
- getValue: function (item) {
- return item.Username;
- }
- }, {
- name: "Email",
- width: 3,
- getValue: function (item) {
- return item.Email;
- }
- }, {
- name: "Firstname",
- width: 3,
- getValue: function (item) {
- return item.Firstname;
- }
- }, {
- name: "Lastname",
- width: 3,
- getValue: function (item) {
- return item.Lastname;
- }
- }
- ],
-
- onItemClicked: function(item)
- {
- console.log("edit clicked", item);
- },
-
- onItemChecked: function(item, checked)
- {
- console.log("edit checked", item, checked);
- },
-
- getLoadPagePromise: function (page, perPage, query, promise)
- {
- return luticateAuthUsers.getAll({page: page, perPage: perPage, query: query}, promise);
- },
-
-
-
- getDelPromise: function (id, promise) {
- return luticateAuthUsers.del({user_id: id}, promise);
- },
-
- getEditController: function () {
- return "UserEdit";
- },
-
- onItemDeleted: function(item)
- {
- console.log("edit removed", item);
- },
-
- onItemEdited: function(item)
- {
- console.log("edit edited", item);
- },
-
- onItemAdded: function(item)
- {
- console.log("edit added", item);
- },
-
- canDelete: 'LU_USER_DEL',
-
- canEdit: function()
- {
- return true;
- },
-
- canAdd: function()
- {
- return true;
- }
- };
-
- $scope.luUserPicker = {
- columns: [
- {
- name: "Username",
- width: 3,
- getValue: function (item) {
- return item.Username;
- }
- }, {
- name: "Email",
- width: 3,
- getValue: function (item) {
- return item.Email;
- }
- }, {
- name: "Firstname",
- width: 3,
- getValue: function (item) {
- return item.Firstname;
- }
- }, {
- name: "Lastname",
- width: 3,
- getValue: function (item) {
- return item.Lastname;
- }
- }
- ],
-
- onItemClicked: function(item)
- {
- console.log("user clicked", item);
- },
-
- onItemChecked: function(item, checked)
- {
- console.log("user checked", item, checked);
- },
-
- getLoadPagePromise: function(page, perPage, query, promise)
- {
- return luticateAuthUsers.getAll({page: page, perPage: perPage, query: query}, promise);
- },
-
- onPageChanged: function()
- {
- console.log("user page", $scope.luUserPicker.page);
- },
-
- getItemText: function(item)
- {
- return item.Username;
- }
- };
- }]);
|