jQWidgets Forums

jQuery UI Widgets Forums Grid Issue with Grid "getrows" method!

This topic contains 3 replies, has 2 voices, and was last updated by  Peter Stoev 11 years, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Issue with Grid "getrows" method! #28489

    Nguyen Huu Hanh Lam
    Participant

    i have a grid with 1 field have “cellsrenderer” property, i update this field then save all datas from grid through “getrows” method, but it only save visible rows, the rest rows are unsave.

    Example:

    (visible rows – display rows on grid)

    1 | AF | AFGHANISTAN | myfield
    2 | AX | ÅLAND ISLANDS | myfield
    3 | AL | ALBANIA | myfield
    4 | DZ | ALGERIA | myfield
    5 | AS | AMERICAN SAMOA | myfield

    (invisible rows)

    6 | AD | ANDORRA | myfield
    7 | AO | ANGOLA | myfield
    8 | AI | ANGUILLA | myfield
    9 | AQ | ANTARCTICA | myfield

    myfields on 6,7,8,9 not save.
    But when i scroll down vertical scroll bar to the end of grid, it save all datas.

    Hope revieve your answer soon. Best and regards.

    Issue with Grid "getrows" method! #28490

    Peter Stoev
    Keymaster

    Hi Nguyen Huu Hanh Lam,

    “getrows” returns all the rows loaded in the view and take into account Filtering, Sorting and Paging. It does not return only the visible rows, it returns all rows loaded in the Grid. Of course, if you do virtual scrolling/paging, all the rows loaded in the Grid are only the visible rows, because in this mode the Grid loads data on demand and does not store it. That’s the reason it is called “virtual”.

    Best Regards,
    Peter Stoev

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

    Issue with Grid "getrows" method! #28501

    Nguyen Huu Hanh Lam
    Participant

    Thanks for yours fast reply!

    in my case , i dont use virtual , any paging or filtering mode, as my example above i got wrong result: like this:

    (visible rows – display rows on grid)

    1 | AF | AFGHANISTAN | myfield
    2 | AX | ÅLAND ISLANDS | myfield
    3 | AL | ALBANIA | myfield
    4 | DZ | ALGERIA | myfield
    5 | AS | AMERICAN SAMOA | myfield

    (invisible rows)

    6 | AD | ANDORRA | myfield
    7 | AO | ANGOLA | myfield
    8 | AI | ANGUILLA | myfield
    9 | AQ | ANTARCTICA | myfield

    —> result when used “getrows”

    1 | AF | AFGHANISTAN | myfield(ok)
    2 | AX | ÅLAND ISLANDS | myfield(ok)
    3 | AL | ALBANIA | myfield(ok)
    4 | DZ | ALGERIA | myfield(ok)
    5 | AS | AMERICAN SAMOA | myfield(ok)

    (invisible rows)

    6 | AD | ANDORRA | myfield(null)
    7 | AO | ANGOLA | myfield(null)
    8 | AI | ANGUILLA | myfield(null)
    9 | AQ | ANTARCTICA | myfield(null)

    fields in blue color is good, myfields in red color not save.

    Best Regards,
    Lam

    Issue with Grid "getrows" method! #28506

    Peter Stoev
    Keymaster

    Hi Lam,

    As I already written and I know how “getrows” work, the method returns all rows loaded in the Grid. In addition, you can use “cellsrenderer” only to change the representation of a cell i.e display its text in different color or background or display some custom html in the cell, but you cannot use “cellsrenderer” to update the value of a cell and “getrows” will not return your custom cell representation. It returns the rows with the cell values.

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.