Browse Source

item picker test

develop
Robin Thoni 9 years ago
parent
commit
b752249349

+ 60
- 10
luticate/controllers/test.controller.js View File

52
                     console.log(item, checked);
52
                     console.log(item, checked);
53
                 },
53
                 },
54
 
54
 
55
-                getLoadPagePromise: function (page, perPage, promise) {
55
+                getLoadPagePromise: function (page, perPage, promise)
56
+                {
56
                     return luticateAuthUsers.getAll({page: page, perPage: perPage}, promise);
57
                     return luticateAuthUsers.getAll({page: page, perPage: perPage}, promise);
57
-                },
58
-
59
-                luBusy: "luBasicTable"
58
+                }
60
             };
59
             };
61
 
60
 
62
-
63
             $scope.luEditTable = {
61
             $scope.luEditTable = {
64
                 columns: [
62
                 columns: [
65
                     {
63
                     {
92
                 onItemClicked: function(item)
90
                 onItemClicked: function(item)
93
                 {
91
                 {
94
                     console.log("edit clicked", item);
92
                     console.log("edit clicked", item);
95
-                    return false;
96
                 },
93
                 },
97
 
94
 
98
                 onItemChecked: function(item, checked)
95
                 onItemChecked: function(item, checked)
99
                 {
96
                 {
100
                     console.log("edit checked", item, checked);
97
                     console.log("edit checked", item, checked);
101
-                    return false;
102
                 },
98
                 },
103
 
99
 
104
-                getLoadPagePromise: function (page, perPage, promise) {
100
+                getLoadPagePromise: function (page, perPage, promise)
101
+                {
105
                     return luticateAuthUsers.getAll({page: page, perPage: perPage}, promise);
102
                     return luticateAuthUsers.getAll({page: page, perPage: perPage}, promise);
106
                 },
103
                 },
107
 
104
 
108
-                luBusy: "luEditTable",
109
-
110
 
105
 
111
 
106
 
112
                 getDelPromise: function (id, promise) {
107
                 getDelPromise: function (id, promise) {
144
                     return true;
139
                     return true;
145
                 }
140
                 }
146
             };
141
             };
142
+
143
+            $scope.luUserPicker = {
144
+                columns: [
145
+                    {
146
+                        name: "Username",
147
+                        width: 3,
148
+                        getValue: function (item) {
149
+                            return item.Username;
150
+                        }
151
+                    }, {
152
+                        name: "Email",
153
+                        width: 3,
154
+                        getValue: function (item) {
155
+                            return item.Email;
156
+                        }
157
+                    }, {
158
+                        name: "Firstname",
159
+                        width: 3,
160
+                        getValue: function (item) {
161
+                            return item.Firstname;
162
+                        }
163
+                    }, {
164
+                        name: "Lastname",
165
+                        width: 3,
166
+                        getValue: function (item) {
167
+                            return item.Lastname;
168
+                        }
169
+                    }
170
+                ],
171
+
172
+                onItemClicked: function(item)
173
+                {
174
+                    console.log("user clicked", item);
175
+                },
176
+
177
+                onItemChecked: function(item, checked)
178
+                {
179
+                    console.log("user checked", item, checked);
180
+                },
181
+
182
+                getLoadPagePromise: function(page, perPage, promise)
183
+                {
184
+                    return luticateAuthUsers.getAll({page: page, perPage: perPage}, promise);
185
+                },
186
+
187
+                onPageChanged: function()
188
+                {
189
+                    console.log("user page", $scope.luUserPicker.page);
190
+                },
191
+
192
+                getItemText: function(item)
193
+                {
194
+                    return item.Username;
195
+                }
196
+            };
147
     }]);
197
     }]);

+ 1
- 1
luticate/index.html View File

29
     <script src="../bower_components/luticate-utils/src/lubusy.js"></script>
29
     <script src="../bower_components/luticate-utils/src/lubusy.js"></script>
30
     <script src="../bower_components/luticate-utils/src/lubasictable.js"></script>
30
     <script src="../bower_components/luticate-utils/src/lubasictable.js"></script>
31
     <script src="../bower_components/luticate-utils/src/luedittable.js"></script>
31
     <script src="../bower_components/luticate-utils/src/luedittable.js"></script>
32
-    <script src="../bower_components/luticate-utils/src/luitempicker.js"></script>
32
+    <script src="../bower_components/luticate-utils/src/lupickertable.js"></script>
33
     <script src="../bower_components/luticate-utils/src/lupermissionsedit.js"></script>
33
     <script src="../bower_components/luticate-utils/src/lupermissionsedit.js"></script>
34
     <script src="../bower_components/luticate-utils/src/luhaspermission.js"></script>
34
     <script src="../bower_components/luticate-utils/src/luhaspermission.js"></script>
35
     <script src="../bower_components/luticate-utils/src/modals/dialogerror.js"></script>
35
     <script src="../bower_components/luticate-utils/src/modals/dialogerror.js"></script>

+ 0
- 1
luticate/views/itempicker.html View File

1
-<lu-basic-table options="pickerOptions"></lu-basic-table>

+ 6
- 0
luticate/views/lupickertable.html View File

1
+<div class="col-sm-3">
2
+    <div ng-repeat="item in pickerOptions.pickedItems">
3
+        {{ pickerOptions.getItemText(item) }}
4
+    </div>
5
+</div>
6
+<lu-basic-table options="pickerOptions" class="col-sm-9"></lu-basic-table>

+ 1
- 1
luticate/views/modals/userpicker.html View File

1
 <dialog-close title="Select users">
1
 <dialog-close title="Select users">
2
-    <lu-item-picker options="userPicker" lu-model="selectedUsers"></lu-item-picker>
2
+    <lu-picker-table options="userPicker" ></lu-picker-table>
3
 </dialog-close>
3
 </dialog-close>

+ 3
- 2
luticate/views/test.html View File

1
 <div class="container">
1
 <div class="container">
2
-    <!--<lu-basic-table options="luBasicTable" class="row col-sm-8 col-sm-offset-2" ></lu-basic-table>-->
3
-    <lu-edit-table options="luEditTable" class="row col-sm-8 col-sm-offset-2" ></lu-edit-table>
2
+    <!--<lu-basic-table options="luBasicTable" class="row col-sm-8 col-sm-offset-2" ></lu-basic-table>
3
+    <lu-edit-table options="luEditTable" class="row col-sm-8 col-sm-offset-2" ></lu-edit-table>-->
4
+    <lu-picker-table options="luUserPicker" class="row col-sm-8 col-sm-offset-2"></lu-picker-table>
4
 </div>
5
 </div>

+ 1
- 1
luticate/views/users.html View File

1
 <!-- Page Content -->
1
 <!-- Page Content -->
2
 <div class="container">
2
 <div class="container">
3
-    <lu-edit-table options="luTable" class="row col-sm-8 col-sm-offset-2" ></lu-edit-table>
3
+    <lu-edit-table options="luTable" class="row col-sm-8 col-sm-offset-2"></lu-edit-table>
4
 </div>
4
 </div>

Loading…
Cancel
Save