1

在我的 TST 和 PRD 环境之间,我在 SharePoint 2007 上遇到了一些“奇怪”的差异。我正在自定义列表的 EditForm,我注意到我在 TST 上创建的新表单正确显示如下: 正确的显示格式

这是我想要的风格。但是,当我在 PRD 上执行完全相同的操作时,这就是我得到的结果,请注意额外的表单字段标签和围绕相同两个字段的包装器: 带有额外字段容器和字段标签的显示格式不正确

(生成的 html 文件的)来源也不同:

    Correctly displayed:

<tr><td width="190px" valign="top" class="ms-formlabel"><H3 class="ms-standardheader"><nobr>Profit Centre<span class="ms-formvalidation"> *</span></nobr></H3></td>
<td width="400px" valign="top" class="ms-formbody"><span dir="none">
        <input name="ctl00$m$g_193d5406_ba72_454b_b14c_87873ba714d6$ff5_1$ctl00$ctl00$TextField" type="text" value="ALL" maxlength="255" id="ctl00_m_g_193d5406_ba72_454b_b14c_87873ba714d6_ff5_1_ctl00_ctl00_TextField" title="Profit Centre" class="ms-long" /><br>
    </span></td></tr>
<tr><td width="190px" valign="top" class="ms-formlabel"><H3 class="ms-standardheader"><nobr>Status<span class="ms-formvalidation"> *</span></nobr></H3></td>
<td width="400px" valign="top" class="ms-formbody"><span dir="none"><select name="ctl00$m$g_193d5406_ba72_454b_b14c_87873ba714d6$ff6_1$ctl00$DropDownChoice" id="ctl00_m_g_193d5406_ba72_454b_b14c_87873ba714d6_ff6_1_ctl00_DropDownChoice" title="Status" class="ms-RadioText">
                    <option selected="selected" value="Not Yet Reconciled">Not Yet Reconciled</option>
                    <option value="Reconciled">Reconciled</option>
                    <option value="Reviewed">Reviewed</option>
                    <option value="Rejected by Reviewer">Rejected by Reviewer</option>
                    <option value="Approved">Approved</option>
                    <option value="Rejected by Approver">Rejected by Approver</option>

                </select><br></span></td></tr>


===========================================================
Annoying wrapper displayed:

<tr><td width="190px" valign="top" class="ms-formlabel"><H3 class="ms-standardheader"><nobr>Profit Centre<span class="ms-formvalidation"> *</span></nobr></H3></td>
<td width="400px" valign="top" class="ms-formbody">
<div align="left" class="ms-formfieldcontainer">
<div class="ms-formfieldlabelcontainer" nowrap="nowrap">
<span class="ms-formfieldlabel" nowrap="nowrap">Profit Centre</span></div>
<div class="ms-formfieldvaluecontainer">
<span dir="none">
        <input name="ctl00$m$g_7716bb24_9fc9_4e72_a2c6_bec888418014$ff6_1$ctl00$ctl00$TextField" type="text" value="ALL" maxlength="255" id="ctl00_m_g_7716bb24_9fc9_4e72_a2c6_bec888418014_ff6_1_ctl00_ctl00_TextField" title="Profit Centre" class="ms-long" /><br>
    </span></div></div></td></tr>
<tr><td width="190px" valign="top" class="ms-formlabel"><H3 class="ms-standardheader"><nobr>Status<span class="ms-formvalidation"> *</span></nobr></H3></td>
<td width="400px" valign="top" class="ms-formbody">
<div align="left" class="ms-formfieldcontainer">
<div class="ms-formfieldlabelcontainer" nowrap="nowrap">
<span class="ms-formfieldlabel" nowrap="nowrap">Status</span></div><div class="ms-formfieldvaluecontainer">
<span dir="none">
<select name="ctl00$m$g_7716bb24_9fc9_4e72_a2c6_bec888418014$ff7_1$ctl00$DropDownChoice" id="ctl00_m_g_7716bb24_9fc9_4e72_a2c6_bec888418014_ff7_1_ctl00_DropDownChoice" title="Status" class="ms-RadioText">
                    <option value="Not Yet Reconciled">Not Yet Reconciled</option>
                    <option selected="selected" value="Reconciled">Reconciled</option>
                    <option value="Reviewed">Reviewed</option>
                    <option value="Rejected by Reviewer">Rejected by Reviewer</option>
                    <option value="Approved">Approved</option>
                    <option value="Rejected by Approver">Rejected by Approver</option>
                </select><br></span></div></div></td></tr>

如何删除额外的字段容器和相关字段标签?为什么它在这两个 SP2007 环境中表现不同?

非常感谢您的提示和回答。提前致谢。

4

1 回答 1

1

事实证明,这两种环境具有不同的风味。TST 环境正在运行 Microsoft.SharePoint.dll 版本 = 12.0.6421.1000 的 SharePoint Content Management Server。而 PRD 环境是企业版,Microsoft.SharePoint.dll 版本 = 12.0.6565.5001。

并感谢 Mirjam 提供了这个出色的解决方案: http ://social.msdn.microsoft.com/Forums/en-CA/sharepointcustomization/thread/f00d37d3-2254-44fa-8f4d-ae7683c645cf

解决方法是注入一段 CSS 样式表来覆盖这两个 OOB 类:

<style type="text/css">
.ms-formfieldlabelcontainer {
    display: none;
}
.ms-formfieldvaluecontainer {
    border: 0px;
    border-style:hidden;
    padding:0px;
    margin:0px;
}
</style>

现在一切看起来都很棒!

于 2012-05-06T07:01:00.017 回答