You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also there is one more additional module in a separate file
144
+
Also, there is one more additional module in a separate file:
145
145
-__ui.scroll.jqlite__ module (it is empty since it was deprecated in v1.6.0)
146
146
147
147
@@ -179,9 +179,9 @@ The `expression` can be any angular expression (assignable expression where so s
179
179
180
180
#### Assignable expressions
181
181
182
-
The `assignable expressions` will be used by scroller to inject the requested value into the target scope. The target scope locating is based on AngularJS $parse service. If the viewport is presented (the element marked with the uiScrollViewport directive), then the scope associated with the viewport will be a start point in the target scope locating. If not, the scope next to ui-scroll local scopes (ui-scroll parent scope) will be a start point.
182
+
The `assignable expressions` will be used by scroller to inject the requested value into the target scope. The target scope locating is based on AngularJS $parse service. If the viewport is presented (the element marked with the uiScrollViewport directive), then the scope associated with the viewport will be a start point in the target scope locating. If not, the scope next to the ui-scroll local scopes (ui-scroll parent scope) will be a start point.
183
183
184
-
Please notice that property defined via `assignable expression` could be unavailable in case of nested scopes and non-explicit assignment. For example, if you want to have the Adapter on some controller's scope and there are intermediate scopes in between (obtained by ng-if or whatever), you should use Controller As syntax or explicitly define at least two-level object hierarchy on your controller:
184
+
Please notice that properties defined via `assignable expression` could be unavailable in case of nested scopes and non-explicit assignment. For example, if you want to have the Adapter on some controller's scope and there are intermediate scopes in between (due to ng-if for example), you should use Controller As syntax or explicitly define at least two-level object hierarchy on your controller:
185
185
186
186
```
187
187
<div ng-controller="MyController">
@@ -196,37 +196,40 @@ Please notice that property defined via `assignable expression` could be unavail
196
196
197
197
### Datasource
198
198
199
-
Data source is an object to be used by the uiScroll directive to access the data.
199
+
Datasource is an object to be used by the uiScroll directive to access the data.
200
200
201
201
The directive will locate the object using the provided data source name. It will first look for a property with the given name on its
202
202
$scope ([here](https://github.com/angular-ui/ui-scroll/blob/master/demo/scopeDatasource) is the example of
203
203
scope-based datasource usage). If none found it will try to get an angular service with the provided name
204
204
([here](https://github.com/angular-ui/ui-scroll/blob/master/demo/serviceDatasource) is the example of
205
205
service-based datasource usage).
206
206
207
-
The data source object implements methods and properties to be used by the directive to access the data.
207
+
The datasource object implements methods and properties to be used by the directive to access the data.
208
208
209
209
* Method `get`
210
210
211
-
get(descriptor, success)
212
-
or
213
-
214
211
get(index, count, success)
212
+
or
213
+
214
+
get(descriptor, success)
215
215
216
216
This is a mandatory method used by the directive to retrieve the data.
217
217
218
218
Parameters
219
-
***descriptor** is an object defining the portion of the dataset requested. The object will have 3 properties. Two of them named `index` and `count`. They have the same meaning as in the alternative signature when the parameters passed explicitly (see below). The third one will be named either `append` if the items will be appended to the last item in the buffer, or `prepend` if they are to be prepended to the first item in the buffer. The value of the property in either case will be the item the new items will be appended/prepended to. This is useful if it is easier to identify the items to be added based on the previously requested items rather than on the index. Keep in mind that in certain use cases (i.e. on initial load) the value of the append/prepend property can be undefined.
220
-
***index** indicates the first data row requested
221
-
***count** indicates number of data rows requested
219
+
***index** indicates the first data row requested.
220
+
***count** indicates number of data rows requested.
222
221
***success** function to call when the data are retrieved. The implementation of the data source has to call this function when the data are retrieved and pass it an array of the items retrieved. If no items are retrieved, an empty array has to be passed.
222
+
***descriptor** is an object defining the portion of the dataset requested. The object will have 3 properties. Two of them named `index` and `count`. They have the same meaning as in the alternative signature when the parameters passed explicitly (index-count based). The third one will be named either `append` if the items will be appended to the last item in the buffer, or `prepend` if they are to be prepended to the first item in the buffer. The value of the property in either case will be the item the new items will be appended/prepended to. This is useful if it is easier to identify the items to be added based on the previously requested items rather than on the index. Keep in mind that in certain use cases (i.e. on initial load) the value of the append/prepend property can be undefined.
223
223
224
224
_Important!_ Make sure to respect the `index` and `count` parameters of the request. The array passed to the success method should have
225
225
exactly `count` elements unless it hit eof/bof.
226
226
227
227
* Properties `minIndex` and `maxIndex`
228
228
229
-
As the scroller receives the items requested by the `get` method, the value of minimum and maximum values of the item index are placed in the `minIndex` and `maxIndex` properties respectively. The values of the properties are cumulative - the value of the `minIndex` will never increase, and the value of the `maxIndex` will never decrease - except the values are reset in response to a call to the adapter `reload` method. The values of the properties are used to maintain the appearance of the scroller scrollBar.
229
+
As the scroller receives the items requested by the `get` method, the value of minimum and maximum values of the item index are placed in the `minIndex` and `maxIndex` properties respectively. These values are used to maintain the appearance of the scrollbar. The values of the properties can be internaly changed by the ui-scroll engine in three cases:
230
+
* reset both properties in response to a call to the adapter `reload` method;
231
+
* increment `minIndex` in response to deleteing the topmost element via adapter `applyUpdates` method;
232
+
* decrement `maxIndex` in response to deleteing anything other than the topmost element via adapter `applyUpdates` method.
230
233
231
234
Values of the properties can be assigned programmatically. If the range of the index values is known in advance, assigning them programmatically would improve the usability of the scrollBar.
232
235
@@ -479,7 +482,11 @@ PR should include source code (./scr) changes, may include tests (./test) change
0 commit comments