Skip to content
开发文档
能力中心
应用市场
WebOffice
开发者后台

ViewShare.EditableFieldIds(属性)

说明

可读写 返回当前分享视图高级权限中,允许编辑的字段id

返回值

Object

浏览器环境示例

javascript
async function example() {
    await instance.ready();
    const view = instance.Application.Sheets(1).Views(1);
    const viewShare = view.ViewShare
    
    // read
    const editableFieldsInfo = await viewShare.EditableFieldsInfo;
    
    // write
    // 所有字段可编辑
    viewShare.EditableFieldsInfo = {type: 'All'}

    // 当前视图中索引为1的字段,在分享视图中可编辑
    const fields = view.Fields;
    const fieldId = await fields(1).Id
    viewShare.EditableFieldsInfo = {
        type: 'Custom',
        ids: [fieldId]
    }
}

脚本编辑器 示例

javascript
function main() {
    const view = Application.Sheets(1).Views(1);
    const viewShare = view.ViewShare
    
    // read
    const editableFieldsInfo = viewShare.EditableFieldsInfo;
    
    // write
    // 所有字段可编辑
    viewShare.EditableFieldsInfo = {type: 'All'}
    
    // 当前视图中索引为1的字段,在分享视图中可编辑
    const fields = view.Fields;
    const fieldId = fields(1).Id
    viewShare.EditableFieldsInfo = {
        type: 'Custom',
        ids: [fieldId]
    }
}
main()
回到旧版