Browser side API reference

class TrStr(stringname, args)

An i18n-aware (translatable) string.

class YajiPopupMenuButton()

A special clove::PopupMenuButton connected to application’s action execution framework. This is part of a particular piece of internal infrastructure and is typically not required to be used directly.

class YajiDataStore(dscfg)

A special clove::AjaxAsyncDatasource backed by a datasource on application code side. See also app.Application.create_datastore() and app.Application.bindserver().

class YajiConfiguration(app)

The application configuration. See also app.Application.appconfig().

YajiConfiguration.addHandler(key, fct, runAlsoOnNeutralAssignments)
Adds a configuration handler for a config key. It gets called whenever the value for this key

changes, and also directly if there already is something stored for that key at execution time.

param key The configuration key. param fct The handler function. param runAlsoOnNeutralAssignments If to run it also for assignments that have not changed the value.

YajiConfiguration.getConfig(key)

Returns a configuration value by key. param key The configuration key.

YajiConfiguration.setConfig(key, value)

Requests to set a configuration value for a key. Note: This happens asynchronously by a request to the backend. param key The configuration key. param value The new configuration value.

class YajiClientEvents(app)

Internal handling of client events. See YajiClient.addEventHandler(). This is part of a particular piece of internal infrastructure and is typically not required to be used directly.

class AbstractFilesystemDialog(config)

Abstract filesystem picker dialog builder. See subclasses.

AbstractFilesystemDialog.showDialog()

Shows the dialog and calls either onsuccess or oncancel.

class OpenFileDialog(config)

Open file dialog builder.

class OpenDirectoryDialog(config)

Open directory dialog builder.

class Dialog(dlgdata)

A dialog (either modal or non-modal). This is part of a particular piece of internal infrastructure and is typically not required to be used directly.

class YajiDialogs(app)

Manager for backend controlled dialogs.

class YajiUserFeedback(app)

User feedback manager. This is used for simple dialogs like message boxes, input boxes, and so on.

YajiUserFeedback.registerHandler(kind, fct)

Registers a handler for a custom kind of user feedback dialog. param kind The custom dialog kind name. param fct The custom handler function for this dialog kind.

YajiUserFeedback.show(feedbackcfg, onanswered)

Shows a feedback dialog by feedback configuration and calls a callback for the answer. param feedbackcfg Feedback configuration, incl. kind and some kind-dependent parameters. param onanswered The callback for the dialog answer.

class PyHtmlViewSupport(app)

Browser side support for PyHtmlView.

This is part of a particular piece of internal infrastructure and is typically not required to be used directly.

PyHtmlViewSupport._onwindowclose()

Used by PyHtmlView when the user tries to close the window.

class YajiAjaxError(url, httpcode, body)

Backend errors in answering ajax requests.

class YajiAjaxRequest(app)

Handle object for an ajax request (triggered by YajiClient.ajax()).

class Curtain()

User interface curtains are used for disabling parts of the user interface during some backend operations.

The default implementation disables the entire user interface with a modal busy animation for that, so in many cases you have to subclass an own implementation.

Curtain.close()

Implements closing the curtain, so blocking some parts of the user interface in some ways. Override this method in custom subclasses or leave the default implementation. If you override it, also override open().

Curtain.execute(fct)

Executes a function inside the curtain, so the curtain gets closed before, and gets opened when processing is idle again.

Curtain.open()

Implements opening the curtain, so unblocking the user interface again. Override this method in custom subclasses or leave the default implementation. If you override it, also override close().

class YajiClient()

The application main object. Usually you can access it by just yaji.

YajiClient.OnUiShutdown

A clove::Event that is triggered on user interface shutdown. See also YajiClient.uiShutdown().

YajiClient.addEventHandler(key, fct)

Adds a handler function for a backend event. See app.Application.triggerevent(). param key The event key (or event ‘name’). param fct The handler function. Receives the event data as first argument.

YajiClient.ajax(config)

Makes an ajax request.

It returns a Promise-like object, so it can be `await`ed.

config may contain the same as for $.ajax, and also: - finished: Callback that gets executed after either success or error. - alsoAfterShutdown: If to make that request even if the ui is already stopped. param config The request configuration.

YajiClient.appconfig

Instance of YajiConfiguration.

YajiClient.getClientlocalDatastore(name)

Returns a browser side datasource by name. See also app.Application.create_clientlocal_datastore() and app.Application.binddata(). param name The datasource name.

YajiClient.getDatastore(name)

Returns a application code side datasource by name. See also app.Application.create_datastore() and app.Application.binddata(). param name The datasource name.

YajiClient.hasExternalCloseControls

If this client view has dedicated external close controls (e.g. via PyHtmlView).

YajiClient.isStaticApplication

If the application is static. See app.Application.storeasstaticapplication().

YajiClient.isrunning

If the application is currently running.

YajiClient.mainview

Instance of clove::MainView.

YajiClient.pyhtmlview

Instance of PyHtmlViewSupport.

YajiClient.ready(fct)

Executes a function on startup once the yaji app is initialized. param fct The function to execute.

YajiClient.stop(forceBlockUiDuringRequest)

Completely stops the application, including application code side. See app.Application.stop() for explanation about stop procedure, and also YajiClient.uiShutdown(). param forceBlockUiDuringRequest If to force freezing the user interface by a modal panel (which automatically

happens only in some situations) during stop request.

YajiClient.tryJsonStringify(o)

Returns a json representation for an object, just containing primitive values, arrays and dicts. param o The object to serialize.

YajiClient.uiShutdown()

Shuts down the user interface (without killing the backend). See also YajiClient.stop().

YajiClient.userfeedback

Instance of YajiUserFeedback.