jQWidgets Forums

jQuery UI Widgets Forums Grid Reliably finding a row's element

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 10 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Reliably finding a row's element #55219

    Alatar
    Participant

    Given the cell editing demo (Cell Editing), how would I go about getting the DOM element of a given row?

    In other controls, such as the Combo Box, calls like $('#comboBox').jqxComboBox('getItems'); will return objects with an element field, that directly links the item object to its element (provided it is in view).

    However, when I call any of getrowdata, getrows, getboundrows, or getdisplayrows, there is no reference to a row’s element.

    In the given demo, the grid’s scrollbar dynamically adds and removes items as it scrolls, making a simple index reference impractical. The row elements do not appear to contain any data- values, so referencing them based off of some unique ID is also a no-go.

    With these limitations in mind, how do I get from a display or bound index of a row, to the DOM element that is the row?

    Reliably finding a row's element #55240

    Peter Stoev
    Keymaster

    Hi Alatar,

    You cannot get a DOM element from jqxGrid. If you want to get the rows, use the “getrows” method. If you want to customize the rendering of the widget, you will have to implement cellsrenderer callback functions of your columns. Regarding the ComboBox – there is no public API for getting an HTML Element from an item. I would also suggest you to avoid using non documented API as it changes over time.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.