jQWidgets Forums

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts

  • Dmitry Istomin
    Participant

    Hi, Peter!

    Thank you for your solution! As long as it solves the issue – it is fine. Actually, problem is not the solution but the API description. This feature is not obvious and it is not described there so there is no any way to understand it from reading documentation. Perhaps, it is good idea to declare and clarify that feature.

    Thank you!


    Dmitry Istomin
    Participant

    Hi, Peter!

    Thanks for your reply. But for me it does not really make sense. Why do I need to specify this value property? The string is compiled and it looks like “Item 1” – there is no any placeholder or keyword to use this value.

    It is also not obvious at API description. It does not say anything about value usage inside the HTML:

    Adds a new item to the jqxListBox. Returns ‘true’, if the new item is added or ‘false’ if the item is not added.

    The following fields can be used for the new item:
    label – determines the item’s label.
    value – determines the item’s value.
    disabled – determines whether the item is enabled/disabled.
    checked – determines whether item is checked/unchecked.
    hasThreeStates – determines whether the item’s checkbox supports three states.
    html – determines the item’s display html. This can be used instead of label.
    group – determines the item’s group.

    Is it possible to resolve?

    Thanks!


    Dmitry Istomin
    Participant

    Sorry, I realized that I was wrong about subtreeElement. It is a container for item elements and not a first child as I thought before. Here is a code which gets children for a particular element:

    $(parentElement.subtreeElement).children(‘li’).each(function (i, c) {
    item = e.jqxTree(‘getItem’, c);
    //Some code which uses item object
    })

    But anyway, it would be great to have a function getChildren(parent) which returns sub-items as objects. And if you provide no parent (or provide null) then it returns you all root items (e.g. those which do not have a parent).

    Thanks!


    Dmitry Istomin
    Participant

    Hi, Peter!

    Sorry, I probably mislead you. By select I meant get – get objects of items dynamically at runtime. I will try to explain myself to be more clear.

    Result of getItems does not have any hierarchy. To get all root items I need to go through each item and check whether a parentElement property is null.

    To get children of a particular item that is retrieved by getItem I need to call getItem again using subtreeElement property and then read nextItem property of each subsequent item until it is null.

    So in each case we have to iterate through each item in a result to get a list of item’s children. I think it would be much better if you have items property in each item object or have getChildren method.

    Please correct me if I am wrong.

    Thank you!


    Dmitry Istomin
    Participant

    Hi, Dimitar!

    I believe there are more of them. Those that I know about are items and icon. Is there any source that I can see all of them?

    Thank you!


    Dmitry Istomin
    Participant

    +1 to Andy. If I am correct, you have to go through all the list of items to select children for a particular element. It would be great to have an opportunity of doing this without any iterations.

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