bootstrap3

Simplicite.UI.View. bootstrap3

new bootstrap3(app, engine, view)

Description:
  • Bootstrap V3 tools. These tools are used when BOOTSTRAP_VERSION system parameter's value is 3

Parameters:
Name Type Description
app

Business application

engine

Main UI controller

view

View engine

Methods

accordion(ctn)

Description:
  • Manage collapsible panels as accordion

Parameters:
Name Type Description
ctn Object

container of panels .collapse

actionButton(a, o, rowid, onClick, minified)

Description:
  • Button of action

Parameters:
Name Type Description
a Object

Action { name, label, level, primary, icon, help, showLabel, toState, custom, enabled, disabled, style, size }

o BusinessObject

Business object

rowid string

Optional row ID

onClick function

Handler

minified boolean

hide label ?

actionIcon(p)

Description:
  • Icon button

Parameters:
Name Type Description
p Object

optional parameters

Properties
Name Type Description
name string

action name

title string

title as tooltip

placement string

tooltip placement (default 'bottom')

icon string | $

glyphicon name or icon

size string

optional size (e.g. 'sm' for small)

click function

handler

actionPlus(items, right, dropUp)

Description:
  • Create a 'plus' button

Parameters:
Name Type Description
items

Array of item (li)

right

Align popup to the right of button

dropUp

on top ?

addTab(t, tab, active)

Description:
  • Add a tab

Parameters:
Name Type Description
t jQuery

existing tabs

tab Object

tab options { title, icon, content, hidden, click, key, data }

active boolean

activate this tab?

alert(h, level)

Description:
  • Simple alert content

Parameters:
Name Type Description
h

HTML content

level

optional info|success|warning|danger

button(p)

Description:
  • Create a button

Parameters:
Name Type Description
p Object

options

Properties
Name Type Description
id string

button optional id

name string

button name (attribute data-action and class 'btn-*')

icon string | $

optional icon name (e.g. 'star') or icon

label string

button label

tooltip string

optional tooltip

click function

optional callback

size string

optional size (e.g. 'sm' for small)

level string

optional level (e.g. 'default','primary', 'plus')

type string

optional type (e.g. 'submit', default 'button'</code<)

disabled string

disabled ?

buttonHelp(name, help, title)

Description:
  • Return a simple help icon with a popover or a dialog when help is too long

Parameters:
Name Type Description
name string

button name

help string

text or html

title string

optional title of dialog

check(d)

Description:
  • Simple checkbox or radio

Parameters:
Name Type Description
d Object

id, name, value, label, disabled, change, type

Properties
Name Type Description
id string

input id

name string

input name

value string

hidden value

label string

label

inline boolean

inlined in form?

disabled boolean

disabled?

readonly boolean

readonly?

checked boolean

checked?

change function

optional handler

type string

'checkbox' (default) or 'radio'

col(size, content)

Description:
  • Simple column

Parameters:
Name Type Description
size string

media-width (i.e short syntax 'md-5' or long syntax 'col-lg-4 col-md-8'), default 'col-xs-12'

content jQuery | Array.<jQuery>

optional content or array of contents

compat()

Description:
  • Backward compatibility with V3: nothing to do

danger(h)

Description:
  • Simple error

Parameters:
Name Type Description
h

Content

dialog(p)

Description:
  • Dialog box

Parameters:
Name Type Description
p Object

String content or object

Properties
Name Type Description
name string

optional name

title string

optional dialog title (rich content)

help string

contextual help

type string

optional 'error|danger|warning|info'

content string | jQuery

dialog body

closeable boolean

true to add a close button in header

fade boolean

false to remove fade effect (default true)

modal boolean

true to disable click outside dialog and ESC keyboard button

nav boolean

true to create a new navigation in dialog

overflow boolean

true to add scrollbars

width string

optional width (ex: '600px' or '80%'), forced to 100% on XS device

slide string

optional 'left|right' with swipe event

buttons Array

optional footer actions [{ name, label, style:'primary|success|info[danger|default', callback or click, close:true|false, disabled:true|false }]

buttonsHeader Array

optional header actions

onload function

optional callback when displayed

beforeunload function

optional callback when closing (use preventDefault to cancel)

unload function

optional callback when closed

dontAskAgain function

optional 'dont't ask again' callback

dialogClose(dlg, cbk)

Description:
  • Close the dialog box

Parameters:
Name Type Description
dlg string | jQuery

name or modal, undefined = close the top dialog if unset, "all" = close all

cbk function

optional callback when dialog is closed

displayField()

Description:
  • Field rendering

displayFieldSearch()

Description:
  • Field search rendering

displayLinkSearch()

Description:
  • Link search rendering (for N,N pillbox)

Description:
  • Create a dropdown button

Parameters:
Name Type Description
elt

optional left side of button

btn

toggle button

items Object

List of $ or action { name, label, icon, cbk|callback|click }

right

align popup on right side of button

dropUp

true to drop on the top of button

dropup(elt, btn, items, right)

Description:
  • Create a dropup button

Parameters:
Name Type Description
elt

optional left side of button

btn

toggle button

items Object

List of $ or action { name, label, icon, cbk }

right

align popup on right side of button

fieldDatePicker(elt, type, lang, dateformat, startDate, rdg)

Description:
  • Datetime picker

Parameters:
Name Type Description
elt

button to attach with picker

type

field type TYPE_DATE | DATETIME | TIME

lang

user language

dateformat

date format

startDate

optional start date

rdg

optional rendering limit Y|M|D|H|I|S

fieldDatePickerSearch(f, filter, id, options)

Description:
  • Datetime picker for search

Parameters:
Name Type Description
f Object

Object field

filter string

Field filter YYYY-MM-DD HH:MI:SS or YYYY-MM-DD

id string

input id

options Object

{ searchby:(on list column), position:(default "bottom-left") }

form(p)

Description:
  • Simple form

Parameters:
Name Type Description
p Object

{ name, inline, content, autocomplete, onsubmit }

formGroup(name, label, inp, msg)

Description:
  • Form group of input

Parameters:
Name Type Description
name

group name

label

optional label or text

inp

input group

msg

optional message

formGroupSearch(cls, label, input)

Description:
  • Form group for search form

Parameters:
Name Type Description
cls

class

label

text

input

input

getDialog(dlg)

Description:
  • Find a visible dialog

Parameters:
Name Type Description
dlg string

optional dialog, name or "all", or returns the top level dialog if unset

getTabActive(t)

Description:
  • Get the active tab anchor with data

Parameters:
Name Type Description
t jQuery

tabs

getTabPane(t, index)

Description:
  • Get a tab container

Parameters:
Name Type Description
t jQuery

tabs

index number | string

tab index or tab data-key

getTabs(t, s)

Description:
  • Get the tab anchors with data

Parameters:
Name Type Description
t jQuery

tabs

s string

optional anchor selector

getTemplate()

Description:
  • Get template for v3 (with panel)

getVersion()

Description:
  • Bootstrap 3 full version (ex 3.3.4)

help(h)

Description:
  • Simple help

Parameters:
Name Type Description
h

Content as safe HTML (any script is ignored)

hideTooltips()

Description:
  • Clear remaining tooltips

icon(name, cls)

Description:
  • Simple icon

Parameters:
Name Type Description
name string

glyph icon name or prefixed by gly/ fas/ far/

cls string

optional class name

image(src)

Description:
  • Get responsive image (.img-responsive)

Parameters:
Name Type Description
src string

source

input(a)

Description:
  • Input with attributes

Parameters:
Name Type Description
a Object

Optional attributes

inputGroup(inp, addons)

Description:
  • Create an input group with addons actions

Parameters:
Name Type Description
inp

Input

addons Array | Object

Array of $ or actions { name, label, icon, plus, cbk }

isDialogModal(dlg)

Description:
  • Is the dialog modal (no keyboard ESC and no close button) ?

Parameters:
Name Type Description
dlg string

optional name or top level dialog if unset

load()

Description:
  • Load bootstrap libs

message(m)

Description:
  • Inlined message alert

Parameters:
Name Type Description
m string | Object

string or { level, label }

panel(params)

Description:
  • Simple panel

Parameters:
Name Type Description
params Object

{ id, title, icon, content, hidden, collapsed, onCollapsed, footer }

Properties
Name Type Description
id string

panel id

title string | jQuery

optional title or header

icon string

optional icon name

content string | jQuery

body

hidden boolean

hidden?

collapsed boolean

collapsed?

onCollapsed function

optional collapse handler

footer string | jQuery

optional footer

progressBar(id, p)

Description:
  • Progress bar

Parameters:
Name Type Description
id

Progress div or id

p

value in percent [0..100]

radio(d)

Description:
  • Simple radio

Parameters:
Name Type Description
d Object

id, name, value, label, disabled, change

Properties
Name Type Description
id string

input id

name string

input name

value string

hidden value

label string

label

disabled boolean

disabled?

readonly boolean

readonly?

checked boolean

checked?

change function

optional handler

readSearch(ctn, o, noRemove)

Description:
  • Read the search form into object filters

Parameters:
Name Type Description
ctn jQuery

form container

o Simplicite.Ajax.BusinessObject

Object

noRemove boolean

true to keep filter with default "%"

ready()

Description:
  • Home is displayed

removeTab(t, index, prev)

Description:
  • Remove a tab

Parameters:
Name Type Description
t jQuery

tabs

index number | string

tab index or tab data-key

prev boolean

click on previous (or next) tab if exists

row(cols)

Description:
  • Create a row with columns

Parameters:
Name Type Description
cols

Array of columns

select(a, o)

Description:
  • Select with options

Parameters:
Name Type Description
a Object

Object with attributes

o Array

Array of { value, label, data }

setTabContent(t, index, content)

Description:
  • Set a tab content

Parameters:
Name Type Description
t jQuery

tabs

index number | string

tab index or tab data-key

content string

HTML content

showTab(t, id, show)

Description:
  • Show/hide a tab in a tabs and ensure to activate a visible tab

Parameters:
Name Type Description
t jQuery

tabs

id string

tab id

show boolean

false to hide the tab

showTabs(t, fn, cls)

Description:
  • Show/Hide empty tabs and ensure to activate a non-empty tab

Parameters:
Name Type Description
t jQuery

tabs

fn function

optional function to test if a tab is visible

cls string

class 'hidden' or 'empty' to hide the tab

Returns:

true if the tabs is visible = contains something visible

spanIcon(p)

Description:
  • Icon button

Parameters:
Name Type Description
p Object

optional parameters

Properties
Name Type Description
name string

action name

title string

title as tooltip

placement string

tooltip placement (default 'bottom')

icon string

icon name (default 'star')

click function

handler

right boolean

true to pull on right side

success(h)

Description:
  • Simple info

Parameters:
Name Type Description
h

Content

tabBadge(tab, val)

Description:
  • Add/Replace a badge counter to tab

Parameters:
Name Type Description
tab

tab href or any tab content element

val

badge value (no badge if null)

tabs(params)

Description:
  • Simple tabs

Parameters:
Name Type Description
params Object

{ id, selected, vertical, cls, ondrop, tabs }

Properties
Name Type Description
id string

tab id

selected number

selected tab index (default 0)

vertical boolean

vertical tabs?

underline boolean

underlined tab style

cls string

optional class to add

ondrag function

optional handler(li,cbk) to allow drag

ondrop function

optional handler({li,from,to},cbk) to allow drop

tabs Array

tabs options { title, icon, content, hidden, click, key, data }

tooltip(e, title, placement, html)

Description:
  • Add a tooltip to element

Parameters:
Name Type Description
e

element

title

text or html

placement

optional, default 'bottom'

html

HTML title?

warning(h)

Description:
  • Simple warning

Parameters:
Name Type Description
h

Content