UPDATE (04/2008): Hii kubwa blog kuingia inaonyesha nzuri javascript makao mbinu ya tatizo hili: http://webborg.blogspot.com/2008/04/add-functions-and-events-to-sharepoint.html
UPDATE II: (04/2008): Kuingia hii blog inaonekana kuahidi pamoja: http://www.cleverworkarounds.com/2008/03/13/free-mosswss-2007-web-part-hide-controls-via-javascript/
Mara kadhaa kwa wiki, kama si kila siku, forum users describe a requirement that would normally be met via cascading drop-downs. Kwa mfano, I have mbili udhibiti kuacha chini:
- Orodha ya U.S. mataifa
- Orodha ya U.S. cities.
As responsible UI providers, we want it to operate like this:
- Paul selects a U.S. state from the drop-down.
- This causes the cities drop-down to filter only those cities that belong to the selected state.
- Paul selects a city from this filtered list.
There is no out-of-the-box support for this feature. Kwa kweli, there is no OOB support for any kind of direct intra-form communication. This includes programmatically hiding/enabling/disabling fields in response to field changes elsewhere on the form.
The real objective of this article to to describe possible solutions and these are the options as I know them:
- Develop a custom column type. As a custom-column-developer, you have full control over the "world" of that custom column. You can implement a cascading drop-down that way.
- Consider using workflow. In some cases, you want to automatically assign a value to field based on another field’s value. Katika kesi hiyo, you would normally try to use a calculated column, but some times, it just won’t get the job done. SharePoint Designer workflow is a relatively administer-friendly alternative to dropping down into code and visual studio. If you go this route, be aware of the issue addressed by makala hii (http://paulgalvin.spaces.live.com/blog/cns!CC1EDB3DAA9B8AA!405.entry).
- Event handlers: Like workflow, this is an after-the-fact solution. Your event handler is a .NET assembly (C #, VB.NET) to which SharePoint passes control. The object you develop has access to the data of the list (and the whole object model) and can do any needed calculation.
- Use SharePoint Designer to create custom entry forms. I don’t have direct experience with this approach, lakini nasikia wanafanya mambo mazuri na NewForm.aspx siku hizi 🙂
- Roll your own ASP.NET data entry function (as a stand-alone web page or as a web part) and use that instead.
If anyone knows other and/or better options, please post a comment and I’ll update the body of this post.
<mwisho />
Paulo,
Angalia hii nje: http://www.spsdev.com/filter.aspx .
Kutoka kwa tovuti yao: "SpsDev.Com’s Filter Field is a custom field type that does filtering.
Unaweza kuongeza moja kwa mashamba mengi chujio kwa orodha yako au maktaba, na kila mmoja anaweza
be filtered based on another filtered field in the list. Pick a state in
shamba moja, na orodha ya miji katika uwanja ijayo ni kuchujwa kwa kuonyesha tu
vitu kutoka hali ya kuwa, kwa mfano. In this release we support SQL Server
2000 na 2005, and Xml as sources for the field data. As you change a
selection in any of the drop downs, all of the drop downs below it are each
filtered to show only the appropriate choices based on the selection that’s
been made."
– Monjo