jQWidgets Forums

jQuery UI Widgets Forums TreeGrid keyDataField has to be unique?

This topic contains 4 replies, has 2 voices, and was last updated by  Klaus H 11 years, 3 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • keyDataField has to be unique? #49806

    Klaus H
    Participant

    Hi,

    I have a tree grid with JSON data and a multi stage hierarchy. I have defined keyDataField and parentDataField correctly.

    The data structure includes a position number for each hierarchy, because each keyDataField entry may occur more than once in the same level of hierarchy due to technical specification.

    I assume you use the specified keyDataField as id field for a level, because when I look at the data, the position with the keyDataField occurs e.g. two times, but the rows have identical data from the last occurrence in the data. If I click on one of the rows, both rows get selected.

    Is there any workaround for that behaviour or should I try to change my keyDataField and find a way to make that unique?

    Regards
    Klaus

    keyDataField has to be unique? #49807

    Peter Stoev
    Keymaster

    Hi Klaus,

    Each record should be with unique Key so the keyDataField should be unique. It should point to an ID in your data. You can think about it as the Private Key in DB table.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    keyDataField has to be unique? #49808

    Klaus H
    Participant

    Hello Peter,

    I have a unique key in my data source, but it is not the keyDataField, so there’s no way to seperate keyDataField and id for the lower level branches of the tree?

    I also tried to use another column which is the series of the different positions in hierarchy concatenated which should be unique but is a string – but the result was that there was no hierarchy created at all. Does the keyDataField has to be a numeric value?

    Regards
    Klaus

    keyDataField has to be unique? #49810

    Peter Stoev
    Keymaster

    Hi Klaus,

    The keyDataField is not necessary to be numeric but it is absolutely necessary to be unique.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    keyDataField has to be unique? #49812

    Klaus H
    Participant

    Hello Peter,

    thank you, I found the problem why it did not work with the string, as for unique, I have to look for a workaround.

    Regards
    Klaus

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

You must be logged in to reply to this topic.