Skip to content

Make TabViewItem properties data-bindable. #541

Closed

Description

@hamorphis
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="onPageLoaded">
  <TabView>
    <TabView.items>
      <TabViewItem title="{{ one }}">
        <TabViewItem.view>
            <StackLayout>
                <Label text="{{ one }}" />
            </StackLayout>
        </TabViewItem.view>
      </TabViewItem>
      <TabViewItem title="{{ two }}">
        <TabViewItem.view>
            <StackLayout>
                <Label text="{{ two }}" />
            </StackLayout>
        </TabViewItem.view>
      </TabViewItem>
      <TabViewItem title="{{ three }}">
        <TabViewItem.view>
            <StackLayout>
                <Label text="{{ three }}" />
            </StackLayout>
        </TabViewItem.view>
      </TabViewItem>
    </TabView.items>
  </TabView>
</Page>
var observableModule = require("data/observable"),
    pageData = new observableModule.Observable();

exports.onPageLoaded = function (args) {
    var page = args.object;
    pageData.set("one","1");
    pageData.set("two","2");
    pageData.set("three","3");
    page.bindingContext = pageData;
};  

Activity

  1. stonecourier commented on Aug 4, 2015

    @stonecourier

    Raised this one before. Unfortunately they can't do it with their current implementation. I had to write my own tab class to work around this.

    #331

  2. self-assigned this
    on Aug 27, 2015
  3. added this to the 1.3.0 milestone on Aug 27, 2015
  4. hamorphis commented on Aug 27, 2015

    @hamorphis
    ContributorAuthor

    I am working on this.

  5. modified the milestones: 1.4.0, 1.3.0 on Aug 28, 2015
  6. added
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    and removed on Sep 1, 2015
  7. modified the milestones: 1.3.0, 1.4.0 on Sep 1, 2015
  8. added and removed
    ready for testTSC needs to test this and confirm against live production apps and automated test suites
    on Sep 11, 2015
  9. ortega-io commented on Sep 2, 2017

    @ortega-io

    @hamorphis Was this ever resolved? I see it is marked as solved, but testing the code above it still doesn't work.

    Any way to workaround this? I want to accomplish something that should be so simple: changing the TabViewItem iconSource depending if the tab is selected or not.

  10. lock commented on Aug 28, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  11. locked and limited conversation to collaborators on Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions