Results 1 to 3 of 3

Thread: Proposal for skipping first/last records

  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    403

    Default Proposal for skipping first/last records

    Hi!

    I wan't to propose that 4 options is added to the (I guess) Data Store...

    skipFirst : [true|false|<number>]
    skipLast : [true|false|<number>]
    skipFirstInSet : [true|false|<number>]
    skipLastInSet : [true|false|<number>]

    Explanation:
    skipFirst and skipLast is working on the total record set (across paging).
    skipFirstInSet and skipLastInSet is working on the first and last row(s) in a paging set.

    If any of these options is set to...
    true then the data store should not handle the first and/or last 1 record.
    false then the data store should (the default) handle the first and/or last 1 record.
    <number> then the data store should not handle the first and/or last n records.

    The "readers" have a for-loop that looks like:
    for (var i = 0; i < root.length - 1; i++) { ... }
    it should be changed to something like:
    for (var i = 0 + skipFirstNumberOfRecords; i < root.length - 1 - skipLastNumberOfRecords; i++) { ... }

    I'm aware that this example does not destinguess between total records and records in a paging set.

    If this is implemented it will make my coding a lot easier as I have to retrieve content from a third-party that have some dummy records before and after the desired content.

  2. #2
    Sencha User JeffHowden's Avatar
    Join Date
    Mar 2007
    Location
    Forest Grove, OR
    Posts
    1,038

    Default

    While more work for you initially, I'd suggest that custom functionality like this is a prime candidate for a custom proxy and/or reader.

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    The simplest way would be a createInterceptor on the reader's "read(response)" method.

Similar Threads

  1. Updating Records of a Data Store
    By aconran in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 13 Feb 2015, 4:34 AM
  2. Replies: 3
    Last Post: 20 Mar 2007, 10:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •