Registry Mirror
Skip to content

Parents binding in ListView item templates is not working until ListView is refreshed. #5054

Closed

Description

@HunterJS-bit

Tell us about the problem

Hello guys I have a quick question I searched forums but couldnt find answer
How can I display my observable in parents if I have 2 or 3 of them
like this:

<Button text="{{ $parents['RadListView'].name + " "+ "$parents['RadListView'].surname" ]] }}" />

This above doesnt works or only gives me one item but what if I want two of them or tree displayed ????

Which platform(s) does your issue occur on?

iOS/Android/Both

Please provide the following version numbers that your issue occurs with:

  • CLI: 3.2.0

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Activity

  1. self-assigned this
    on Nov 9, 2017
  2. NickIliev commented on Nov 9, 2017

    @NickIliev
    Contributor

    @markomiljkovic

    There are a number of syntax errors in the your Button XML line.
    You have double quotes for your second binding and also some closing brackets at the end that are not needed.

    Here is the refactored code that will work

    <Button text="{{ $parents['RadListView'].name + '  '+ $parents['RadListView'].surname }}" />
    

    Demo application demonstrating the above syntax can be found here.

    Meanwhile, it appears that you might have to manually refresh the list view to update all parents binding in the item templates.

    Logging this one as a bug - steps to reproduce use the linked application and
    remove the manual refresh of the list. As a result, the binding will appear only for the few first items or only after the list is scrolled.

  3. changed the title [-]Question: Displaying parents in xml[/-] [+]Parents binding in ListView item templates is not working until ListView is refreshed.[/+] on Nov 9, 2017
  4. HunterJS-bit commented on Nov 9, 2017

    @HunterJS-bit
    Author

    thank you very much its working :)

  5. NickIliev commented on Dec 11, 2017

    @NickIliev
    Contributor

    Reproducible with tns-core-modules@next

  6. removed their assignment
    on Apr 23, 2018
  7. NathanWalker commented on Jul 7, 2020

    @NathanWalker
    Contributor
  8. added 2 commits that reference this issue on Aug 7, 2020
    3eba5cf
    0cb38ec
  9. added a commit that references this issue on Sep 9, 2020
    a429488
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions