Warning Older Docs! - You are viewing documentation for a previous released version of RhoMobile Suite.

Navbar

The NavBar API supports a native navigation bar for iOS devices.

Enabling the API

This API is part of the coreapi extension that is included automatically.

extensions: ["coreapi"]

JavaScript Usage

Be sure to review the JavaScript API Usage guide for important information about using this API in JavaScript

Ruby Usage

Be sure to review the Ruby API Usage guide for important information about using this API in Ruby

Methods

create(HASH navBarProperties)

Removes the current NavBar and replaces it with this one.

Parameters

  • navBarProperties : HASH

    HASH with NavBar elements.

    • left : HASH

      Left button with :action and :label defined.

      • label : STRING

        Label for the button.

      • action : STRING

        URL to call when button is pressed.It may be path to Ruby controller action; i.e. '/app/Account' would load the Account index action. For ruby callback use 'callback:/app/Account' Or JavaScript method to call: 'javascript: methodOnButton();'.

    • right : HASH

      (optional) Right button with :action and :label defined.

      • label : STRING

        Label for the button.

      • action : STRING

        URL to call when button is pressed.It may be path to Ruby controller action; i.e. '/app/Account' would load the Account index action. For ruby callback use 'callback:/app/Account' Or JavaScript method to call: 'javascript: methodOnButton();'.

    • title : STRING

      Title of the navigation bar.

Synchronous Return:

  • Void

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.Navbar.create(HASH navBarProperties)
    • Ruby: Rho::Navbar.create(HASH navBarProperties)

remove()

Removes the current navigation bar. Does nothing if there is no active navigation bar.

Synchronous Return:

  • Void

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.Navbar.remove()
    • Ruby: Rho::Navbar.remove()

started()

Return true is navbar is started (used only for automatic tests)

Synchronous Return:

  • BOOLEAN

Method Access:

  • Class Method: This method can only be accessed via the API class object.
    • JavaScript: Rho.Navbar.started()
    • Ruby: Rho::Navbar.started()