FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Visibility attribute on ActionItem element · Issue #691 · NativeScript/NativeScript · GitHub

Visibility attribute on ActionItem element #691

Description

Hi guys. I didn't found any documentation on how 'visibility' actually works and for which elements. Only related article I've found is http://tjvantoll.com/2015/06/05/nativescript-showing-and-hiding-elements/ .

Now I'm struggling with following visibility manipulation:

  <Page.actionBar>
    <ActionBar title="SampleApp">
      <ActionBar.actionItems>
        <ActionItem text="Stop"
                    tap="stopTimer" ios.position="right"
                    visibility="{{ timerId === 0 ? 'collapse' : 'visible' }}"/>
        <ActionItem text="Resume"
                    tap="startTimer" ios.position="right"
                    visibility="{{ timerId === 0 ? 'visible' : 'collapse' }}"/>
        <ActionItem text="Save"
                    tap="saveEntryToEntriesFile" ios.position="right"
                    visibility="{{ timerId === 0 ? 'visible' : 'collapse' }}"/>
      </ActionBar.actionItems>
    </ActionBar>
  </Page.actionBar>

timerId, is a set property of pageData observable, which holds page context.
First ActionItem should be seen only when timerId is different from 0 and second+third buttons, when timerId is 0.

But currently all ActionItem elements are always visible, no matter timerId is 0 or holds value different from it.

Would be awesome to have a separate documentation chapter describing how to show/hide elements from both xml markup and code, as well as which elements could be dynamically shown/hidden and which are not.

Activity

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL