ProcFu Help
Search
🤖

PfJs for On Render

There is a JavaScript class called PfJs which is included when mini apps run. You can use these functions to to more easily manipulate an app instead of having to write too much code from scratch.

The main functions are:

PfJs.modalShow ( content, noclose )

Shows content in modal window

pass noclose=true to remove the close icon

PfJs.modalHide()

Hides modal window

PfJs.addTabsToForm(target, tabs)

Separates a detail form into tabs

target = On Render target variable tabs = object array of tabs and fields

eg:

PfJs.addTabsToForm(target, [
  {name:"General",fields:["title","category","date"]},
  {name:"Detail",fields:["title","text","image"]},
  {name:"Other",fields:[]},
]);

PfJs.addMapToField(field)

Add a clickable image map to a location field

field = external id of field

PfJs.addGfFlowButton(target, label, c, p, flow_id, item_id, css_class, click_func)

Add a button to the page to trigger a GF Manual Flow

target = optional On Render target variable or DOM element to append to label = Label for button c & p = c & p values of GF hooks in Podio app (see developer section in Podio app) flow_id = ID of flow to trigger item_id = ID of item to trigger on css_class = optional CSS class to add to button click_func = optional function to call after success

PfJs.addGfHookButton(target, label, hook_catch_str, data, css_class, click_func)

Add a button to the page to trigger a GF Webhook

target = optional On Render target variable or DOM element to append to label = Label for button hook_catch_str = string ID of webhook (after /catch/ in URL) data = optional array of data to pass to webhook css_class = optional CSS class to add to button click_func = optional function to call after success

PfJs.makeCheckboxTable(target)

Add checkboxes to table

target = On Render target variable returns id of table

PfJs.getCheckboxes(tabid)

Get checkbox ids from checkbox table

tabid = id of table (returned by makeCheckboxTable) returns array of ids

PfJs.ajaxCall(screenNo, data, okfunc, errfunc)

Simulate ajax call to text screen

screenNo = number id of text screen data = data object to pass, eg {ids:[1,2]} okfunc = function to pass return to (will be text or object if proper JSON) errfunc = function to pass error string to

PfJs.dependentField(parent, options)

create dependent fields in a mini app form

parent = name of field to depend on (parent) options = array of values in parent : name of field to show (or comma-separated list of fields) eg:

PfJs.dependentField("item-source", {"Website":"show-website","Google":"show-google","Other (Please Specify)":"other-text,more-comments"});

PfJs.sqlSearchTable(target, idcol)

Add search inputs to all sql table headers

target = On Render target variable idcol = name of column with id

(c) 2021 ProcFu for Podio - by Globi | Join the Discussion in our Podio Workspace.