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
Copy file name to clipboardExpand all lines: Assets/AppServices/table/query/CustomQuery.cs
+59-58Lines changed: 59 additions & 58 deletions
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,10 @@
3
3
usingUnityEngine;
4
4
5
5
/// <summary>
6
-
/// Query records operation https://msdn.microsoft.com/en-us/library/azure/jj677199.aspx
6
+
/// Implemention of Query records operation https://msdn.microsoft.com/en-us/library/azure/jj677199.aspx
7
7
/// There is a maximum of 50 records returned in a query - use top and skip params to return additional pages of results.
8
-
/// NB: `$inlinecount` (which returns count of all items without paging applied) is not set here as it changes the data model and the way the REST decode callback works makes it intangible to decode.
9
-
/// Rather the '$inlinecount=allpages' param is automically set when using the table's Query method and wrapping your data model with the NestedResults object wrapper.
8
+
/// NB: `$inlinecount` (which returns count of all items without paging applied) is not set here as it changes the data model shape and the way the REST decode callback works makes it non-trival to decode.
9
+
/// Rather the '$inlinecount=allpages' param is automatically set when using the table's Query method and wrapping your data model with the NestedResults object wrapper.
10
10
/// </summary>
11
11
namespaceUnity3dAzure.AppServices
12
12
{
@@ -20,74 +20,75 @@ public enum MobileServiceSystemProperty
20
20
deleted=0x8
21
21
}
22
22
23
-
[CLSCompliant(false)]
24
-
publicclassCustomQuery
25
-
{
23
+
[CLSCompliant(false)]
24
+
publicclassCustomQuery
25
+
{
26
26
// query option parameters defined by the Open Data Protocol (OData)
// NB: setting __systemproperties param doesn't seem to do anything different as these properties are all included by default, but we can append values to the 'select' param.
// scrollY is still at 'top' and so no need to load anything at this point
531
+
if(scrollY>scrollBuffer)
532
+
{
533
+
return;
534
+
}
535
+
// scrollY has reached 'bottom' minus buffer size
536
+
// only trigger request if there are more records to load
537
+
if(_skip<_totalCount)
538
+
{
539
+
_isLoadingNextPage=true;
540
+
_skip+=_noPageResults;
541
+
//Debug.Log (string.Format("Load next page @{0} scroll: {1}<{2}", _skip, scrollY, scrollBuffer));
542
+
GetPageHighscores();
543
+
}
544
+
}
545
+
546
+
// Tip: When infinite scrolling and using TSTableView's ReloadData() method I prefer to wrap "disable and enable scrollbar" calls around it to help prevent jumpy behaviour when continously dragging the scrollbar thumb.
0 commit comments