Rendering Content on an Empty App (Plug-in App)
You can render a widget or a form on to an empty app.
The following sample renders a grid widget on the empty widget that must be written in the listener JS file for the empty widget:
canvas.core.dynamicWidgetManager( { widgetId: 'APP_ACCOUNT', renderTo: 'CUSTOM', containerPanel: $('[data-widgetId=APP_EMPTY_WIDGET]') }); //APP_ACCOUNT is the widget ID of the grid that will be rendered on the empty widget. //APP_EMPTY_WIDGET is the empty widget ID.
For Native mobile apps, a different variant of dynamicWidgetManager is necessary. For example,
canvas.core.dynamicWidgetManager( { widgetId: 'APP_ACCOUNT', renderTo: 'WIDGET', renderToTarget: 'APP_EMPTY_WIDGET' }); //APP_ACCOUNT is the widget ID of the grid that will be rendered on the empty widget. //APP_EMPTY_WIDGET is the empty widget ID.
The following screen shot shows the grid widget inside the empty widget:
The following sample renders a form with its container on the empty widget that must be written in the listener JS file for the empty widget:
CBXDOWNLOADMGR.requestScripts( canvas.downloadProvider.getMergedArray(["FORM_CONTAINER"]), function () { var fm = new canvas.form.FormManager({ formId : "CT_PAYMENT_FORM" }); var config = {}; config.appWidget = "APP_EMPTY_WIDGET"; config.formConRenderType = "APP"; CBXFORMCONTAINER.getWindowByFormObj(fm,"PAYMENTS_FORM_CONTAINER",config); }); //CT_PAYMENT_FORM is the form ID that will be rendered on the empty widget. //APP_EMPTY_WIDGET is the empty widget ID. //APP is the render type, which will render the form as a widget. //PAYMENTS_FORM_CONTAINER is the form container.
The following screen shot shows the form with its container inside the empty widget: