ButtonField (对象)
说明
ButtonField 按钮字段的属性,修改属性之后需要 FieldDescriptor 调用Apply()方法使得修改生效。如果非按钮字段,无法设置相关属性
属性
浏览器环境示例
javascript
async function example() {
await instance.ready();
const Application = instance.Application
const fieldDescriptor = await Application.Sheets("数据表").FieldDescriptors("@按钮")
const prop = await fieldDescriptor.Button
prop.Text = "Get it"
prop.SuccessText = "SucccessText"
prop.TextColor = "#ff00ff"
prop.BackgroundColor = "#000000"
prop.Icon = "calendar_check_in"
fieldDescriptor.Apply()
}
脚本编辑器 示例
javascript
function main() {
const fieldDescriptor = Application.Sheets("数据表").FieldDescriptors("@按钮")
const prop = field.Button
prop.Text = "Get it"
prop.SuccessText = "SucccessText"
prop.TextColor = "#ff00ff"
prop.BackgroundColor = "#000000"
prop.Icon = "calendar_check_in"
fieldDescriptor.Apply()
}
main()