jQuery UI Widgets Forums TreeGrid Trying to use the jqxTreeGrid('getRow') command

This topic contains 1 reply, has 2 voices, and was last updated by  admin 1 week, 5 days ago.

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

  • Alastair Walker
    Participant

    Hi – When I try to use the function:

    var row = jQuery(selector).jqxTreeGrid(‘getRow’);

    I get a ‘undefined’ response.

    The API indicates the command as:

    var row = $(“#table”).jqxTreeGrid(‘getRow’, “1.2”);

    but does not explain the purpose of the “1.2” argument.

    The fiddle solution does not show the example for jqxTreeGrid(‘getRow’), but rather for jqxTreeGrid(‘getRows’);

    Please indicate where I have a misunderstanding.

    Many thanks,

    Alastair


    admin
    Keymaster

    Hi Alastair,

    The issue here is likely related to how jqxTreeGrid(‘getRow’) expects its arguments and the structure of your data. Let’s break down the function:

    Purpose of the “1.2” Argument
    In the jQWidgets jqxTreeGrid API, the getRow function needs an argument that uniquely identifies the row you’re trying to retrieve. Here’s how it works:

    getRow expects a row key as its second argument, typically a unique identifier within the TreeGrid.
    In the example jqxTreeGrid(‘getRow’, “1.2”), “1.2” is a string representing the row key of the specific row you want to access. The row key must match the unique identifier used in your TreeGrid data.
    Common Causes for undefined
    Incorrect Row Key: If “1.2” does not exist as a key in your TreeGrid, getRow will return undefined. Verify that the row you want actually has that specific key.
    Data Structure Check: If you’re not sure of the row keys, you can call jqxTreeGrid(‘getRows’) to retrieve all rows, then examine the structure and row keys in the data to find the correct key for your desired row.
    Syntax: Make sure your jQuery selector is correct and that jqxTreeGrid is initialized on the selector before you call getRow.

    Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.