jQWidgets Forums

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts

  • mdiamond
    Participant

    Note for anyone referring to this post. ensurerowvisible requires a visible index, that is, which row of the grid is displaying the data. The documentation currently says to pass the bound index, which is not right. (Reference: http://www.jqwidgets.com/community/topic/ensurerowvisible-should-accept-bound-index/)

    The jsfiddle above does work, but only if the grid is not being sorted. You can see this by running it, clicking on a column header to sort, then add some rows with the button. The grid will not always scroll to the correct row.

    I was able to work around this by calling getrows. This seems to return the list of rows in sorted order (not sure if that’s documented anywhere.) Then I searched that list to find where my new row ended up. That index could then be passed to ensurerowvisible.


    mdiamond
    Participant

    > It is wrong to call updatebounddata when you add a new row.
    Peter, can you elaborate on when/why this is wrong? A scenario where this might be useful: after saving the data, call commit(true), then reread one or more rows from the server.

    Thanks,
    Matt


    mdiamond
    Participant

    Thanks for the quick reply.

    I recognize that implementing column validations in the client is a valid approach for some projects, but in our project the backend is a a RESTful service that must validate everything sent to it. So we’d rather keep the client validations to a minimum rather than duplicate all the validations. (This also reduces the amount of data the client needs to fetch.)

    Given this design constraint, back my original question. The two options I’m seeing are:
    1) Use a popup window to edit the row.
    2) Let the user leave the row but mark it edited. Keep track of all changed rows, and put a Save button under the grid. The Save function would update each row as it gets successfully saved.

    Comments welcome.

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