我们在 SharePoint 的 BDC(业务数据目录)定义中定义了许多操作,并且需要更改它们在 UI 中显示的顺序。
在 Action 定义中,有一个 Position 字段,我们正在指定该字段,但是,UI 希望按字母顺序显示所有内容,这不是我们想要的。
BDC 定义的位置部分的示例如下所示。
您知道如何才能成功实现这一目标吗?
<Action
Position="10"
IsOpenedInNewWindow="true"
Url="http://www.google.co.uk/search?q=%22{0}%22"
ImageUrl="/_layouts/1033/images/TAH/Google.gif"
Name="Google for Assured Name">
<ActionParameters>
<ActionParameter Index="0" Name="assured_name" />
</ActionParameters>
</Action>
(PS,我确实考虑过将其放在超级用户上,但是那里没有 BDC,并且这里有许多 BDC 相关问题,所以这里是......;))
We have a number of Actions defined in a BDC (Business Data Catalog) definition in SharePoint, and need to change the order they are displayed in the UI.
Within the Action defintion, there is a Position field, which we are specifying, however, the UI wants to display everything in Alphabetical order, which isn't what we are after.
An example of the Position section of the BDC Definition is shown below.
Do you know how this could be achieved successfully ?
<Action
Position="10"
IsOpenedInNewWindow="true"
Url="http://www.google.co.uk/search?q=%22{0}%22"
ImageUrl="/_layouts/1033/images/TAH/Google.gif"
Name="Google for Assured Name">
<ActionParameters>
<ActionParameter Index="0" Name="assured_name" />
</ActionParameters>
</Action>
(PS I did consider putting this on SuperUser, but there is no BDC there, and there are a number of BDC related questions on here, so here it is... ;) )
发布评论
评论(2)
您可以通过操作的命名来完成,例如:
有点黑客,但它应该可以工作。
You could do through the naming of your actions, for example:
A bit of a hack, but it should work.
除了验证其是否存在之外,没有关于
Position
属性的 MSDN 文档(请参阅 操作文档),但假设它应该满足您的要求似乎是合理的。我怀疑缺乏文档是由于该功能没有完全实现。
可能的工作方法是在
Name
属性中添加前导空格。如果 BDC 没有自动删除这些空格,您可以使用它来使字母顺序执行您所需要的操作(您拥有的前导空格越多,操作将显示在列表的越靠下的位置)。当呈现为 HTML 时,空格可能会被去除。There is no MSDN documentation for the
Position
attribute other than verifying its existence (see Action documentation) but it seems reasonable to assume that it should do what you require.I suspect that the lack of documentation is due to this feature not being fully implemented.
Something that may work is to add leading spaces in the
Name
attribute. If BDC does not strip these spaces automatically you could use it to cause the alphabetical ordering to do what you require (the more leading spaces you have, the further down the list the action will appear). When rendered as HTML the spaces will likely be stripped.