跳到主要内容

MoveDown

在填写顺序中将角色向下移动。

语法

expression.MoveDown(name);

expression - 表示 ApiFormRoles 类的变量。

参数

名称必需/可选数据类型默认值描述
name必需string角色名称。

返回值

boolean

示例

在表单文档中下移指定角色。

// How to move down for a form roles?

// Move down and display the result in a form document.

let doc = Api.GetDocument();
let roles = doc.GetFormRoles();
roles.Add("Customer");
roles.Add("Seller");

// Make the selected role the last one to fill
while (roles.MoveDown("Customer"));

let paragraph = doc.GetElement(0);
let orderIndex = 1;
roles.GetAllRoles().forEach(role => {
paragraph.AddText(orderIndex + ": ");
paragraph.AddText(role);
paragraph.AddLineBreak();
orderIndex++;
});