UPDATE (04/2008): Hierdie groot blog inskrywing toon 'n goeie JavaScript benadering tot hierdie probleem: http://webborg.blogspot.com/2008/04/add-functions-and-events-to-sharepoint.html
UPDATE II: (04/2008): Hierdie blog inskrywing lyk goed belowende: http://www.cleverworkarounds.com/2008/03/13/free-mosswss-2007-web-part-hide-controls-via-javascript/
'N paar keer 'n week, indien nie daagliks, forum users describe a requirement that would normally be met via cascading drop-downs. Byvoorbeeld, Ek het twee drop-down kontrole:
- Lys van U.S. state
- Lys van U.S. stede.
As verantwoordelike UI verskaffers, ons wil om dit te bedryf soos hierdie:
- Paul kies 'n 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 kies 'n stad uit hierdie gefilterde lys.
There is no out-of-the-box support for this feature. In werklikheid, 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.
Die ware doel van hierdie artikel om moontlike oplossings te beskryf en dit is die opsies as ek weet hulle:
- 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. In hierdie geval, jy nie normaalweg sou probeer om 'n berekende kolom te gebruik, maar 'n paar keer, 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, bewus wees van die probleem aangespreek deur hierdie artikel (http://paulgalvin.spaces.live.com/blog/cns!CC1EDB3DAA9B8AA!405.entry).
- Event hanteerders: Soos 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 (en die hele voorwerp model) en kan doen nie nodig berekening.
- Use SharePoint Designer to create custom entry forms. I don’t have direct experience with this approach, but I hear they are doing good things with NewForm.aspx these days 🙂
- Rol jou eie ASP.NET data entry funksie (as 'n stand-alone webblad of as 'n web deel) en gebruik dit in plaas.
As iemand weet ander en / of beter opsies, Pos asseblief 'n comment en ek sal die liggaam van hierdie post te werk.
<einde />
Paul,
Check dit uit: http://www.spsdev.com/filter.aspx .
Van hul webwerf: "SpsDev.Com’s Filter Field is a custom field type that does filtering.
Jy kan een van baie filter velde by jou lys of biblioteek, en elkeen
be filtered based on another filtered field in the list. Pick a state in
een veld, en die lys van stede in die volgende veld word gefiltreer om net te wys
items uit dat die staat, byvoorbeeld. In this release we support SQL Server
2000 en 2005, and Xml as sources for the field data. As you change a
keuse in enige van die drop downs, al die drop downs onder dit is elke
gefiltreer slegs die toepaslike keuses gebaseer op die keuse wat is om te wys
gemaak is."
– Monjo