MSDN > フォーラム ホーム > SharePoint - Design and Customization > Disable all day event in Calendar list
質問する質問する
 

回答済みDisable all day event in Calendar list

回答

すべての返信

  • 2009年6月26日 17:03Kyle Schaeffer ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     

    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.

  • 2009年6月26日 19:59KolbyH - MSFT ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    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. 
  • 2009年6月26日 20:08David Lozzi ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     

    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
  • 2009年6月30日 17:05pl7626 ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     コードあり
    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.
  • 2009年6月30日 17:08David Lozzi ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    Interesting... this works for me on the display forms... Thanks for the update!


    David Lozzi
    Delphi Technology Solutions
    Blog  |  LinkedIn | Twitter
  • 2009年6月30日 17:20pl7626 ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    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.
  • 2009年7月2日 22:46sparkymark75 ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     
    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.
  • 2009年7月3日 12:46SP RAJ ユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダルユーザーのメダル
     回答済み
    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.