jQWidgets Forums

jQuery UI Widgets Forums TreeGrid JQXTreeGrid Editing

This topic contains 3 replies, has 2 voices, and was last updated by  Stanislav 7 years, 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • JQXTreeGrid Editing #99954

    robf
    Participant

    Hi,
    Are there any examples of editing JQXTreeGrid whereby I can add new rows at parent and or child location? I see the following example for adding child rows but need flexibility to add new parent and/or children. Thanks!

    I see this one: https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxtreegrid/index.htm#demos/jqxtreegrid/javascript-tree-grid-inline-editing.htm

    JQXTreeGrid Editing #99966

    Stanislav
    Participant

    Hello robf,

    Is this what you are looking for?
    http://jsfiddle.net/rkttb/478/

    Best Regards,
    Stanislav

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

    JQXTreeGrid Editing #99978

    robf
    Participant

    Hi Stanislav,

    That is close. Ultimately what I’m looking for is something like, for example, parent is COUNTRY; children are CITIES

    CountryA
    City1
    City2
    CountryB
    City1
    City2

    Need to be able to add new country, then select/highlight country and add city(s). So need add/update/delete but at either parent or child level. Is this better done with context menu or buttons?

    Is there a better widget to try this with?

    Thanks!
    Rob

    JQXTreeGrid Editing #100003

    Stanislav
    Participant

    Hello robf,

    You can pass 4 parameters to the addRow method:

    
    1) Row Key/ID - unique ID which identifies the row. If null is passed, the jqxTreeGrid will generate an unique ID for the row.
    2) Row Data - Object with Key/Value pairs. To add an empty row, pass {}.
    3) Row Position - string with two possible values - "last" and "first". By default "last" is used.
    4) Parent Row Key/ID - unique ID which identifies the Parent Row. If null is passed, the jqxTreeGrid will add the new row at the first level.
    

    When adding the new row, you will need to get the parent rowKey and pass it.

    Best Regards,
    Stanislav

    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.