Poser une questionPoser une question
 

TraitéeDisable all day event in Calendar list

Réponses

Toutes les réponses

  • vendredi 26 juin 2009 17:03Kyle Schaeffer Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     

    If you re-create the form in a new ASPX page using a data view web part, you should be able to edit the form XSL in order to remove the checkbox.

  • vendredi 26 juin 2009 19:59KolbyH - MSFT Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    Yes, I would agree with Kyle. You can re-create the New and Edit forms to remove the all day option - that way a user can't create an all day event. 
  • vendredi 26 juin 2009 20:08David Lozzi Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     

    You could use javascript on the page, instead of breaking the page inheritance using SPD, to hide the row. Using SPD, throw this at the bottom, outside of the web part zone

    <script language="javascript">
    function HideField(title){
    for(var i = 0; i < document.all.length; i++)
    {
        var el = document.all[i];
        // find html element with specified title
       if(el.title == title)
        {
            var pars;
            pars = el;
            for(var j = 0; j < 10; j++)
            {
                //loop through parents and hide the parent row
               if(pars.className == "ms-formbody")
                    break; //should have the TD object now

                pars = pars.parentNode;
            }         
            pars = pars.parentNode; //get the TR object
            pars.style.display = "none"; //and hide the row
            break;        
        }
    }
    }
    {

    HideField("All Day Event");
    }</script>


    I've written a webpart that also handles this much easier, if you're interested let me know and I'll send it over. Hoping to get it to codeplex soon.
    HTH


    David Lozzi
    Delphi Technology Solutions
    Blog  |  LinkedIn | Twitter
  • mardi 30 juin 2009 17:05pl7626 Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     A du code
    Hi David,

    When I tried the javascript, it didn't work on the Display form. I modified the script a little and now it works on all three forms (display, edit, new). Here's what I used:

    <script type="text/javascript">
    function HideField(title){
    var header_h3=document.getElementsByTagName("h3") ;
    
    for(var i = 0; i <header_h3.length; i++)
    {
        var el = header_h3[i];
        var foundField ;
       if(el.className=="ms-standardheader")
        {
            for(var j=0; j<el.childNodes.length; j++)
            { 
                if(el.childNodes[j].innerHTML == title || el.childNodes[j].nodeValue == title)
                { 
                    var elRow = el.parentNode.parentNode ;
                    elRow.style.display = "none"; //and hide the row
                    foundField = true ;
                    break;
                }
            }        
        }
        if(foundField)
            break ;
    }
    }
    
    HideField("All Day Event");
    HideField("Recurrence") ;
    HideField("Workspace") ;
    </script>
    
    Kyle,

    I'm also interested to know how to recreate the forms in Sharepoint Designer. I'm new to Sharepoint Designer. Do you know of a specific article on creating these forms with the same look and feel as other pages in the site.
  • mardi 30 juin 2009 17:08David Lozzi Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    Interesting... this works for me on the display forms... Thanks for the update!


    David Lozzi
    Delphi Technology Solutions
    Blog  |  LinkedIn | Twitter
  • mardi 30 juin 2009 17:20pl7626 Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    I guess a more simpler solution would be to create a custom list with appropriate fields (start date, end date, etc.) and then creating a calendar view. But You don't get the option to connect it to Outlook 2007. And, when creating a custom list, creating calender view won't give the option for "All Event Event", "Workspace". It also won't have the "Recurrance" functionality.

    In my case, I don't need to (although I wanted to) connect it to Outlook 2007. I added some extra fields to the Calendar List, which doesn't appear in Outlook.
  • jeudi 2 juillet 2009 22:46sparkymark75 Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    If it's a one-off administrative function, i.e the list is created and you simply want to hide the All Day Event field, you can download either SharePoint Manager (CodePlex) or WSS List Configurator (CodePlex) and use those to hide the field. You can even specify which forms to show it on or whether or not just to hide it full stop.
  • vendredi 3 juillet 2009 12:46SP RAJ Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     Traitée
    Parvez, you can use Office Toolbox feature available on Codeplex, which allows site users to get greater control of your New/Edit/Display forms and their fields for show/hide and also field validations

    Hope this helps.