• Basics
  • Abyss
  • Web APIs
  • C# & Razor
  • .net API
  • JS & TS API

    Show / Hide Table of Contents

    Class Paging

    Do Paging to only return a limited amount of results + show how many such pages exist and which Page we are on.

    The Paging DataSource is part of the Standard EAV Data Sources. It will limit the items returned to a page containing just a few items, and will also provide a paging-information so that the UI knows what page it's on and how many pages remain.

    How to use with the VisualQuery

    When using the VisualQuery you can just drag it into your query. This is what it usually looks like:

    The above example shows:

    1. a content-type filter limiting the items to type Company
    2. a Paging which only passes on the first 3 companies of page 1

    Using Url Parameters for Paging

    This example shows how you can use the Url Parameter to page through the results:

    ...you could also set the page size from other tokens like url or app-configuration, like this:

    Programming With The Paging DataSource

    We recommend to use the VisualQuery where possible, as it's easier to understand and is identical for C# and JavaScript. It's also better because it separates data-retrieval from visualization.

    Read also

    • DataSource / DataStream
    • List of all EAV Data Sources
    • Query / VisualQuery

    Demo App and further links

    You should find some examples in this demo App

    • Demo App with examples for most DataSources

    History

    1. Introduced in EAV 4.x, 2sxc ?

    API Documentation

    Inheritance
    System.Object
    ToSic.Lib.Services.ServiceBase
    ToSic.Lib.Services.ServiceBase<ToSic.Eav.DataSource.DataSourceBase.MyServices>
    DataSourceBase
    Paging
    Implements
    IDataSource
    IAppIdentity
    IZoneIdentity
    IAppIdentityLight
    ICacheKey
    ICacheExpiring
    ITimestamped
    IHasLog
    IDataSourceLinkable
    Inherited Members
    DataSourceBase.AppId
    DataSourceBase.ZoneId
    DataSourceBase.Guid
    DataSourceBase.Error
    DataSourceBase.CacheTimestamp
    DataSourceBase.CacheChanged(Int64)
    DataSourceBase.Configuration
    DataSourceBase.Link
    DataSourceBase.In
    DataSourceBase.TryGetIn(String)
    DataSourceBase.TryGetOut(String)
    DataSourceBase.Out
    DataSourceBase.Item[String]
    DataSourceBase.GetStream(String, String, Boolean, Boolean)
    DataSourceBase.List
    DataSourceBase.Attach(IDataSource)
    DataSourceBase.Attach(String, IDataSource, String)
    DataSourceBase.Attach(String, IDataStream)
    DataSourceBase.ProvideOut(Func<IEnumerable<IEntity>>, String)
    DataSourceBase.ProvideOut(Func<IImmutableList<IEntity>>, String)
    Namespace: ToSic.Eav.DataSources
    Assembly: ToSic.Eav.DataSources.dll
    Syntax
    [PublicApi_Stable_ForUseInYourCode]
    [VisualQuery(NiceName = "Paging", UiHint = "Split data into pages and forward just one batch", Icon = "auto_stories", Type = DataSourceType.Logic, NameId = "ToSic.Eav.DataSources.Paging, ToSic.Eav.DataSources", DynamicOut = false, In = new string[]{"Default*"}, ConfigurationType = "|Config ToSic.Eav.DataSources.Paging", HelpLink = "https://r.2sxc.org/DsPaging")]
    public sealed class Paging : DataSourceBase, IDataSource, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheInfo, ICacheKey, ICacheExpiring, ITimestamped, ICanPurgeListCache, IHasLog, IDataTarget, IAppIdentitySync, IDataSourceLinkable
    Remarks

    Had a major, breaking update in v15. Consult the guide to upgrade your custom data sources.

    Properties

    | Improve this Doc View Source

    PageNumber

    The Page number to show - defaults to 1

    Declaration
    [Configuration(Fallback = 1)]
    public int PageNumber { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    PageSize

    The Page size in the paging. Defaults to 10.

    Declaration
    [Configuration(Fallback = 10)]
    public int PageSize { get; set; }
    Property Value
    Type Description
    System.Int32

    Implements

    IDataSource
    IAppIdentity
    IZoneIdentity
    IAppIdentityLight
    ICacheKey
    ICacheExpiring
    ITimestamped
    IHasLog
    IDataSourceLinkable
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX