B4J Question [BANano] Using html template

Discussion in 'B4J Questions' started by Luk, Apr 16, 2019.

  1. Luk

    Luk Member Licensed User


    Is it possible to specify a html template and add the generated javascript to this html file ?
    BANano.HTML_TEMPLATE = "my template.html"
    Or should I use the following method. (javascript is adding the elements)
    Dim j As BANanoElement
        j = BANano.GetElement(
        <div id='content'>      
                <button id="defaultButton">Default</button>
                <button id="primaryButton">Primary</button>
                <button id="infoButton">Info</button>
                <button id="successButton">Success</button>
                <button id="warningButton">Warning</button>
                <button id="dangerButton">Danger</button>
                <button id="inverseButton">Inverse</button>
                <button id="linkButton">Link</button>
    Thanks !
  2. alwaysbusy

    alwaysbusy Expert Licensed User

    You can use BANano.Initialbody = html, but only in AppStart(). The html will be written in the body tag.
    Luk likes this.
  3. Kiffi

    Kiffi Well-Known Member Licensed User

    You could load templates via CallAjax():

    Sub ...

    "./assets/MyTemplate.html""GET""text"Null"MyTemplate"False, CreateMap())

    End Sub

    Sub BANano_CallAjaxResult(Success As Boolean, UniqueID As String, Result As String)
    If Success Then
    Select UniqueID
    Case "MyTemplate"
    End Select
    End If
    End Sub
    Greetings ... Peter
    Mashiane, alwaysbusy and Luk like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice