自定义列表表单 - 自动填充管理器
我有一个 Sharepoint 2007 自定义列表,其中有一列名为“经理”,用于保存用户的经理(单行文本)。
创建新项目时,我希望 NewForm.aspx 使用用户的经理自动计算“经理”字段。
我知道我们可以使用 JQuery 自动计算列表表单字段,以访问作为 Web 服务公开的 Sharepoint 的“用户信息列表”,如下面 Marc 的博客所示:
http://sympmarc.com/2010/04/29/populate-a-sharepoint-list-form-with -the-current-user-information/
我的问题是管理器没有存储在“用户信息列表”中,所以我无法像上面那样检索它,有人有什么想法吗?
谢谢,导航
I have a Sharepoint 2007 custom list with a column named 'Manager', to hold the user's Manager (single line of text).
When creating a new item I want the NewForm.aspx to autopulate the Manager field with the user's manager.
I know we can autopulate list form fields using JQuery to access Sharepoint's 'User Information List' exposed as a webservice, as Marc's blog below:
http://sympmarc.com/2010/04/29/populating-a-sharepoint-list-form-with-the-current-user-information/
My problem is the Manager is not stored in the 'User Information List' so I can not retrieve it as above, anyone have any ideas?
Thanks, Nav
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这很简单,您需要在“listName”下面声明“CAMLQuery”、“CAMLRowLimit”和“CAMLViewFields”,我将用下一个代码示例对此进行解释:
您可以从列表视图中获取 CAMLQuery,在sharepoint Designer打开一个表单,我打开我的视图列表anuncio.aspx并找到下一个代码:
然后根据您的需要或视图列表的查询在您的JavaScript代码中拆分查询caml,
在变量中设置CAMLQuery后,修改你的脚本:
It's very easy, you need to declare a "CAMLQuery", "CAMLRowLimit" and "CAMLViewFields" below of "listName", I'll explain this with the next code example:
You can get your CAMLQuery from a view of you list, in sharepoint Designer open a form, I opened the my view list anuncio.aspx and found the next code:
Then split the query caml in your JavaScript code depends of your needs or query of your view list,
After set the CAMLQuery in the variables, modify your script: