You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何创建侧窗格(Side Pane)时避免其自动展开?

解决Dynamics 365侧窗格创建时自动展开的问题

要让侧窗格创建时保持折叠状态,只需在createPane的配置对象里添加initialState: "collapsed"参数即可,修改后的代码如下:

Xrm.App.sidePanes.createPane({
    title: "Reservation: Ammar Peterson",
    imageSrc: "WebResources/sample_reservation_icon",
    hideHeader: true,
    canClose: true,
    width: 600,
    initialState: "collapsed" // 添加该参数,设置侧窗格初始为折叠状态
}).then((pane) => {
    pane.navigate({
        pageType: "entityrecord",
        entityName: "sample_reservation",
        entityId: "d4034340-4623-e811-a847-000d3a30c619",
    })
});

initialState是侧窗格配置的可选属性,默认值为"expanded"(展开状态),将其设为"collapsed"就能让侧窗格创建完成后保持折叠,用户可手动点击展开。

内容的提问来源于stack exchange,提问作者Vijendra Ram S

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.18 20:03:08