Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Table of Contents | ||||
---|---|---|---|---|
|
Description
Completes an assignment with a specific process instance id & activity instance id
描述
用特定流程实例ID和活动实例ID完成分配
参数Parameters
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
AssignmentManager.completeAssignment('http://localhost/jw', '1_1_activity', 'http://localhost/completed.jsp'); |
Description
Completes an assignment with a specific process instance id & activity instance id with option to set workflow variables
描述
使用特定流程实例标识和活动实例标识完成分配,并带有用于设置工作流程变量的选项
参数Parameters
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
AssignmentManager.completeAssignmentWithVariable('http://localhost/jw', '1_1_activity', 'var_status=new&var_id=123', 'http://localhost/completed.jsp'); |
描述
获取Joget Workflow中当前登录的用户名
Description
Gets the current logged in username in Joget Workflow
Parameters
参数
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var callback = { success : function(response){ //response.username if(response.username != "roleAnonymous"){ console.log("Username is " + response.username); }else{ console.log("User is anonymous"); } } }; AssignmentManager.getCurrentUsername('http://localhost/jw', callback); |
Description
Gets the current logged in username in Joget Workflow
Parameters
描述
获取Joget Workflow中当前登录的用户名(正常登录)
参数
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var callback = { success : function(response){ //response.username && response.isAdmin if(response.username != "roleAnonymous"){ console.log("username (" + response.username + ") is " + ((response.isAdmin !== undefined && response.isAdmin === "true")?"admin":"not an admin")); }else{ console.log("Fail to login user!"); } } }; AssignmentManager.login('http://localhost/jw', 'admin', 'admin', callback); |
Description
Gets the current logged in username in Joget Workflow
Parameters
描述
获取Joget Workflow中当前登录的用户名 (使用Hash 密码)
参数
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var callback = { success : function(response){ //response.username && response.isAdmin if(response.username != "roleAnonymous"){ console.log("username (" + response.username + ") is " + ((response.isAdmin !== undefined && response.isAdmin === "true")?"admin":"not an admin")); }else{ console.log("Fail to login user!"); } } }; AssignmentManager.loginWithHash('http://localhost/jw', 'admin', '14ACD782DCFEB2BCDE2B271CCD559477', callback); |
Description
Gets the current logged in username in Joget Workflow
Parameters
描述
登出
参数
Sample code 示例代码
Code Block | ||
---|---|---|
| ||
AssignmentManager.logout('http://localhost/jw'); |
Description
描述
撤销具有特定活动实例ID的分配Withdraws an assignment with a specific activity instance id
Note |
---|
Deprecated since v3, the concept of accept & withdraw assignment is removed. |
Parameters
已弃用 自v3,接受和撤销分配的概念被删除。 |
参数
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
AssignmentManager.withdrawAssignment('http://localhost/jw', '1_1_activity'); |
...
Description
Initiates Ajax call with JSONP
描述
用JSONP启动Ajax调用
参数Parameters
Sample code
示例代码
Code Block | ||
---|---|---|
| ||
var callback = { success : function(response){ //do something } }; ConnectionManager.ajaxJsonp('http://localhost/test', callback, 'id=4&name=test'); |
Description描述
Initiates Ajax GET to a specific URL
启动Ajax GET 到特定的URL
参数Parameters
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var callback = { success : function(response){ //do something } }; ConnectionManager.get('http://localhost/test', callback, 'id=6&name=test', false); |
Description
Initiates Ajax POST to a specific URL
描述
启动Ajax POST到特定的URL
参数Parameters
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var callback = { success : function(response){ //do something } }; ConnectionManager.post('http://localhost/test', callback, 'id=6&name=test'); |
...
描述
用于获取表单字段的字段对象
Description
Used to gets the field object of a form field
Parameters
参数
Sample code 示例代码
Code Block |
---|
var field = FormUtil.getField("field1"); $(field).val("test"); //set value |
Description
Used to generates the fields value as url query parameter string
Parameters
描述
用于生成字段值作为url查询参数字符串
参数
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var fields = [ {"field":"field1", "param":"p_field1"}, {"field":"field2", "param":"p_field2"}, {"field":"field3", "param":"p_field3", "defaultValue":"default value"}, ]; var queryString = FormUtil.getFieldsAsUrlQueryString(fields); console.log(queryString); //p_field1=Field1%20value&p_field2=Field2%20value;Field2%20second%20value&p_field3=default%20value |
Description
Used to gets the cell objects of every rows of a grid field
Parameters
描述
用于获取grid字段每一行的单元格对象
参数
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var cells = FormUtil.getGridCell("gridId.field1"); $(cells).each(function(){ //do something }); |
Description
Used to gets the cell values of every rows of a grid field and return it in an array.
Parameters
描述
用于获取Grid字段每一行的单元格值并将其返回到数组中。
参数
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var values = FormUtil.getGridCellValues("gridId.field1"); for (var i = 0; i < values.length; i++) { console.log(values[i]); //i equals to row number start from 0 } |
描述
用于获取表单字段的值。
Description
Used to gets the value of a form field.
Parameters
参数
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var value = FormUtil.getValue("field1"); |
Description
Used to gets the values of a form field. Values will return in an array.
Parameters
描述
用于获取表单域的值。值将返回一个数组。
参数
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var values = FormUtil.getValues("field1"); for (var i = 0; i < values.length; i++) { console.log(values[i]); } |
...
Description
Used to creates a popup dialog element.
描述
用于创建一个弹出对话框元素。
参数Parameters
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
JPopup.create("testPopup", "Test Popup Dialog"); |
Used to hides a created and shown popup dialog element.
用于隐藏创建并显示的弹出对话框元素。
参数Parameters
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
JPopup.hide("testPopup"); |
Description
Used to creates a popup dialog element.
描述
用于创建一个弹出对话框元素。
参数Parameters
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var params = { id : "1", name : "test" }; JPopup.show("testPopup", "http://www.joget.org", params); |
Description
Used by system to align the popup dialog to the center of the screen.
描述
系统用来将弹出对话框对准屏幕中心。
参数Parameters
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
UI.adjustPopUpDialog(JPopup.dialogboxes["testPopup"]); |
Description
Used to escapes HTML syntax in a value
描述
用于在值中转义HTML语法
参数Parameters
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var content = "<p>test content</p>"; var escapedContent = UI.escapeHTML(content); console.log(escapedContent); // <p>test content</p> |
Description
Used by the system to calculate the height of a popup dialog for current screen size to support mobile device.
Parameters
描述
系统用于计算当前屏幕大小的弹出对话框的高度以支持移动设备
参数
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var height = UI.getPopUpHeight("500px"); |
Description
Used by the system to calculate the width of a popup dialog for current screen size to support mobile device.
Parameters
描述
系统用于计算当前屏幕大小的弹出对话框的宽度以支持移动设备。
参数
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var width = UI.getPopUpWidth("800px"); |
Description
Used by system to gets the query parameters string that contains the meta of current userview theme in used.
描述
系统使用它来获取包含当前userview主题的meta元素的查询参数字符串。
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var url = "http://localhost/jw/form/embed?" + UI.userviewThemeParams(); |
...
Description
Used to generate a query string based on a parameters object
Parameters
描述
用于基于参数对象生成查询字符串
参数
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var params = { "name" : ["joget"], "email" : ["info@joget.org", "test@joget.org"] }; var queryString = UrlUtil.constructUrlQueryString(params); console.log(queryString); // name=joget&email=info%40joget%2Eorg&email=test%40joget%2Eorg |
Description
Used to encodes the URL parameters in a URL.
Parameters
描述
用于在URL中 编码URL参数
参数
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var url = "http://localhost/jw/test?name=joget&email=info@jogte.org&email=test@joget.org"; var encodedUrl = UrlUtil.encodeUrlParam(url); console.log(encodedUrl); // http://localhost/jw/test?name=joget&email=info%40joget%2Eorg&email=test%40joget%2Eorg |
Description
Used to gets an object contains all parameter as attribute name and its value in an URL.
Parameters
描述
用于获取包含所有参数的对象作为属性名称及其在URL中的值
参数
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var url = "http://localhost/jw/test?name=joget&email=info@jogte.org&email=test@joget.org"; var params = UrlUtil.getUrlParams(url); console.log(params); // {"name" : ["joget"], "email" : ["info@joget.org", "test@joget.org"]} |
Description
Used to merge 2 URL query parameters strings into one query string.
描述
用于将2个URL查询参数字符串合并到一个查询字符串中。
参数Parameters
示例代码 Sample code
Code Block | ||
---|---|---|
| ||
var q1 = "name=joget&email=info@jogte.org&email=test@joget.org"; var q2 = "name=joget team&phone=012345678"; var queryString = UrlUtil.mergeRequestQueryString(q1, q2); console.log(queryString); // name=joget%20team&email=info%40joget%2Eorg&email=test%40joget%2Eorg&phone=012345678 |
...