Main

Simplicite.UI.View. Main

new Main(ui)

Description:
  • Main view

Parameters:
Name Type Description
ui Simplicite.UI.Engine

Main UI controller

Members

_viewTab

Description:
  • Selected tab per view

Selected tab per view

board :Simplicite.UI.View.Board

Description:
  • Board renderer

Board renderer

Type:

color :Simplicite.UI.View.Color

Description:
  • Color helpers

Color helpers

Type:

crosstab :Simplicite.UI.View.Crosstab

Description:
  • Crosstab renderer

Crosstab renderer

Type:

external :Simplicite.UI.View.External

Description:
  • External object renderer

External object renderer

Type:

form :Simplicite.UI.View.Form

Description:
  • Form renderer

Form renderer

Type:

index :Simplicite.UI.View.Index

Description:
  • Index search renderer

Index search renderer

Type:

list :Simplicite.UI.View.List

Description:
  • List renderer

List renderer

Type:
Description:
  • Menu renderer

Menu renderer

Type:

merge :Simplicite.UI.View.Merge

Description:
  • Merge object renderer

Merge object renderer

Type:

prefs :Simplicite.UI.View.Prefs

Description:
  • Preferences renderer

Preferences renderer

Type:
Description:
  • Search renderer

Search renderer

Type:

social :Simplicite.UI.View.Social

Description:
  • Social renderer

Social renderer

Type:

timesheet :Simplicite.UI.View.Timesheet

Description:
  • Timesheet object renderer

Timesheet object renderer

Type:

tray :Simplicite.UI.View.Tray

Description:
  • Trays renderer

Trays renderer

Type:

tree :Simplicite.UI.View.Tree

Description:
  • Tree renderer

Tree renderer

Type:

update :Simplicite.UI.View.Update

Description:
  • Update renderer

Update renderer

Type:

widget :Simplicite.UI.View.Widget

Description:
  • Widget renderer

Widget renderer

Type:

wkf :Simplicite.UI.View.Workflow

Description:
  • Workflow renderer

Workflow renderer

Type:

Methods

changePassword()

Description:
  • Change password

compact(ctn, enable)

Description:
  • Turn the container to compact mode

Parameters:
Name Type Description
ctn jQuery

Container

enable boolean

optional to enable or disable (default toggle the mode)

Returns:

true if compacted

connectAs()

Description:
  • Connect as other login

createNav(work, content)

Description:
  • Create a new navigation in a work area: adding a splittable zone with a .desk including the .nav and .content parts

Parameters:
Name Type Description
work string | jQuery

work zone

content string | jQuery

optional HTML content to display

ensureVisible()

Description:
  • Ensure element to be visible in container

fieldEnter(ctn, fg, fn)

Description:
  • ENTER KEY management = focus the next form-group, or call a function on the last input

Parameters:
Name Type Description
ctn jQuery

container

fg jQuery

form-group with a field input

fn function

optional function to call after the last input

focus(x)

Description:
  • Focus elmeent

Parameters:
Name Type Description
x

'l'ist, 'm'enu, 'n'ext area, 'f'inder or element

getAction(ctn, obj, action, silent)

Description:
  • Get UI extended action

Parameters:
Name Type Description
ctn jQuery

Container

obj Simplicite.Ajax.BusinessObject

Business object

action string | Object

Name or action metadata

silent boolean

true to ignore message 'unknown action'

Returns:

The action with action.ui = instance of Simplicite.UI.View.UIAction

getArea(ctn, obj, area, silent)

Description:
  • Get UI extended area

Parameters:
Name Type Description
ctn jQuery

Container

obj Simplicite.Ajax.BusinessObject

Business object

area string | Object

Name or area metadata

silent boolean

true to ignore message 'unknown area'

Returns:

The area with area.ui = instance of Simplicite.UI.View.UIArea

getContent(ctn)

Description:
  • Find the first .content element if exists in container (or #work)

Parameters:
Name Type Description
ctn jQuery

container, null = #work

Returns:

the first .content element in container, or the container itself if not exist

getField(ctn, obj, field, index, silent)

Description:
  • Get field definition with UI extension

Parameters:
Name Type Description
ctn jQuery

Parent container where the field is displayed

obj Simplicite.Ajax.BusinessObject

Business object

field string | Simplicite.Ajax.ObjectField

name or field

index string

Optional list index

silent boolean

true to ignore message 'unknown field'

Returns:

The field with field.ui = component implementation of Simplicite.UI.View.UIField

getView(ctn, obj, view, silent)

Description:
  • Get UI extended view

Parameters:
Name Type Description
ctn jQuery

Container

obj Simplicite.Ajax.BusinessObject

Business object

view string | Object

Name or view metadata

silent boolean

true to ignore message 'unknown view'

Returns:

The view with view.ui = instance of Simplicite.UI.View.UIView

hideLoading(ctn)

Description:
  • Hide the loading spinner

Parameters:
Name Type Description
ctn jQuery

optional container

icon(icon, options)

Description:
  • Get icon

Parameters:
Name Type Description
icon string

prefixed icon name: icon set 'name', fontawesome 'fas/name' or 'far/name', bootstrap icon 'bi/name'

options Object | string | number

{ size, cls } | class name | number: size in px

image(image)

Description:
  • Get a static image (located in root/images/image)

Parameters:
Name Type Description
image string

name

initMain(p)

Description:
  • Prepare the main page when loaded

Parameters:
Name Type Description
p Simplicite.UI.Globals

launch parameters merged with Globals

isVisible(x, slide, apply)

Description:
  • Checks if element is visible = not empty (without any visible field, action, text or view)

Parameters:
Name Type Description
x jQuery

Element to test

slide boolean

Slide effect?

apply boolean

true to show/hide empty element or false to only check the visibility

Returns:

true id visible = not empty

langPicker(cbk)

Description:
  • Language selector

Parameters:
Name Type Description
cbk function

Optional callback(lang)

markdownToHTML(v)

Description:
  • Markdown to HTML if parser loaded

Parameters:
Name Type Description
v string

Markdown text

Returns:

text or HTML if marked plugin loaded

moduleChooser()

Description:
  • Modules filtering for designers

notify(e)

Description:
  • Notification handler

Parameters:
Name Type Description
e Object

Event { type:create|update|delete, object, rowId, item:when known } sent to '.js-notify' elements with 'ui.notify' handler

reload()

Description:
  • Reload UI data: refresh current page and treeviews

resize(ctn, w, h, reload)

Description:
  • Resize event on .js-resizable with ui.resize handler

Parameters:
Name Type Description
ctn jQuery

optional container to resize (default all page)

w number

New viewport width

h number

New viewport height

reload boolean

true to force a redraw of components

serviceLost()

Description:
  • Popup when service is lost (no internet or server down)

setApps(b, apps)

Description:
  • Init the multi-apps popup

Parameters:
Name Type Description
b jQuery

Scopes container with apps

apps Array.<Object>

Array of granted scope { icon|logo, label, url, home }

setContent(ctn, html, url, cbk)

Description:
  • Replace the content

Parameters:
Name Type Description
ctn jQuery

Container

html string

Optional HTML content (full page or embedded elements)

url string

Or optional URL to load in iframe .frame-wrapper

cbk function

Optional callback

shortcuts(list, ctn, opt)

Description:
  • Displays the shortcuts

Parameters:
Name Type Description
list Array.<Object>

Array of granted shortcut { name, icon, label, url, target }

ctn jQuery

UI container

opt Object

option plus, header xor home

showLoading(ctn)

Description:
  • Show the loading spinner (widget waitdlg)

Parameters:
Name Type Description
ctn jQuery

optional container (full body if undefined or #work area if null)

  • explicit element in page
  • undefined: displayed on "body"
  • null: displayed on #work area

showProgress(ctn, params)

Description:
  • Show a job progression

Parameters:
Name Type Description
ctn Object

optional container (in a dialog if null)

params Object

parameters

Properties
Name Type Description
name string

optional job name (default 'progress')

title string

optional label

circular boolean

true for a circular bar

service function

required service(fn) to get progression

delay function

delay of refresh in ms (default 1000)

callback function

optional callback({percent,message}) during progression

skeleton(ctn, type, tmpl)

Description:
  • Put a skeleton loader in the container

Parameters:
Name Type Description
ctn jQuery

container

type string

optional type list|form

tmpl string

optional form template

split(ctn, pos, options)

Description:
  • Split the container in 2 parts (any previous split is removed)

Parameters:
Name Type Description
ctn jQuery

container

pos string

position left|right|top|bottom, default 'top'

options object | jQuery

optional parameters or content

Properties
Name Type Description
content jQuery

content to add at position

resizable boolean

can resize content ?

height string

optional content height

width string

optional content width (in rem, px, %)

collapsible boolean

can collapse content ?

collapsed boolean

collapsed by default ?

splitWidth boolean

optional split wifth (default 100%, may be "auto" to let the scroll-x to parent element)

splitHeight boolean

optional split height (default 100%, may be "auto" to let the scroll-y to parent element)

theme(themes)

Description:
  • Theme picker

Parameters:
Name Type Description
themes Array.<string>

list of themes

trigger(target, event, data)

Description:
  • UI trigger handler

Parameters:
Name Type Description
target string

selector (ex js-notify)

event string

event name (ex ui-notify)

data Array

trigger data

undoredo(ctn, use)

Description:
  • Init Undo/Redo controls

Parameters:
Name Type Description
ctn jquery

Container

use boolean | string

true|false|'keys'

unsplit(ctn)

Description:
  • Remove the splitted content

Parameters:
Name Type Description
ctn jQuery

container with content

zoom(p)

Description:
  • Zoom changes all relative styles based on font-size relative size (rem)

Parameters:
Name Type Description
p number | string

relative number or absolute string percentage value ('100%' = original size = 1rem = 16px)