jQWidgets Forums

jQuery UI Widgets Forums TreeGrid Expand selected row on button click

This topic contains 4 replies, has 2 voices, and was last updated by  Hristo 7 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • Expand selected row on button click #98615

    dan123
    Participant

    Hi i have this treegrid where only once i select row and then click the button should expand the row and its children. Not sure how but i have posted my example.

    Here is my jsfiddle:
    http://jsfiddle.net/675mL/450/

    Expand selected row on button click #98622

    Hristo
    Participant

    Hello dan123,

    You should set ID as an argument of the expandRow method.
    When you use getSelection it return an array of records.
    Please, check the received data and set there ID of the row that you want to expand.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Expand selected row on button click #98637

    dan123
    Participant

    Thanks Hristo, one more help i needed was that i also created a rowDoubleClick event to expand selected row. Now i am trying to bind rowDoubleClick event to also collapse a row as well.

    Example:
    1. Double Click row and it will expand (This part i completed it)
    2. Double Click again on same row and it will collapse (This part i need help on)

    Here is my jsfiddle:
    http://jsfiddle.net/uxsy7z3y/11/

    Expand selected row on button click #98657

    dan123
    Participant

    Hi Hristo, i created the event and it works but one problem though, only doesn’t work on this scenario.

    Test:
    1. Click Row Andrew (Expands row)
    2. Click Row Steven (Expands row)
    3. Go back and Click Row Andrew (This should collapse the row, but it doesn’t)

    Here is my jsfiddle:
    http://jsfiddle.net/uxsy7z3y/13/

    Expand selected row on button click #98671

    Hristo
    Participant

    Hello dan123,

    The used approach does not use our API and I cannot engage to provide a solution with this.
    You could try to get all rows with getRows method of the TreeGrid and each one record has a member expanded and you could check by this and them use your logic again.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.