jQuery UI Widgets Forums Grid row id & row index

This topic contains 2 replies, has 2 voices, and was last updated by  yuanru 10 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • row id & row index #66760

    yuanru
    Participant

    Could some one tell me what is the difference between rowid and rowindex.
    It seems that they are the same. Is there any cases they are different value?

    Thanks!

    row id & row index #66763

    Dimitar
    Participant

    Hello yuanru,

    The row’s id and its index are different – the id is determined by the datafield passed to the source id property, e.g.:

    var source =
    {
        datatype: "json",
        datafields: [
            { name: 'name', type: 'string' },
            { name: 'type', type: 'string' },
            { name: 'calories', type: 'int' },
            { name: 'totalfat', type: 'string' },
            { name: 'protein', type: 'string' }
        ],
        id: 'id',
        url: url
    };

    However, if no id is specified, the row’s id is equal to the row’s bound index. The bound index is the row’s index not considering sorting, filtering and paging. The row’s visible index is determined by taking in mind the applied sorting, filtering and paging.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

    row id & row index #66764

    yuanru
    Participant

    Thanks Dimitar! It really helps!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.