Posts tonen met het label disable. Alle posts tonen
Posts tonen met het label disable. Alle posts tonen

vrijdag 11 oktober 2013

Disable a Hyperlink field without knowing the ID of your Sharepoint Field


I'm starting to write my own sharepoint helperclass with functions 
that can be called without knowing the ID's of the Sharepoint Fields, 
but by using the field Display Names. 

This function is to Disable or Enable a Sharepoint Hyperlink Field.


// call the function
// DisableHttpLink ("DISPLAYNAME", True) to disable the field
// DisableHttpLink ("DISPLAYNAME", False) to enable the field
  
function DisableHttpLink(titel, b_disable)
{
 var TD = $('nobr:contains("'+ titel + '")').closest("td").next("td").find('input');
    for(var i = 0; i < TD.length;i++)
    {
  $("#" + TD[i].id).attr("disabled",b_disable);
    }
}
 

donderdag 10 oktober 2013

Disable a Choice field without knowing the ID of your Sharepoint Field


I'm starting to write my own sharepoint helperclass with functions 
that can be called without knowing the ID's of the Sharepoint Fields, 
but by using the field Display Names. 

This function is to Disable or Enable a Sharepoint Choice Field.


// call the function
// DisableAChoiceField ("DISPLAYNAME", "input|select", True) to disable the field
// DisableAChoiceField ("DISPLAYNAME", "input|select", False) to enable the field
  
function DisableAChoiceField(titel, type, b_disable)
{
    if (type == "input")
  var TD = $('nobr:contains("'+ titel + '")').closest("td").next("td").find('input');
    if (type == "select")
  var TD = $('nobr:contains("'+ titel + '")').closest("td").next("td").find('select');
    for(var i = 0; i < TD.length;i++)
    {
  $("#" + TD[i].id).attr("disabled",b_disable);
    }
}
 

woensdag 9 oktober 2013

Disable a PeoplePicker Field without knowing the ID of your Sharepoint Field


I'm starting to write my own sharepoint helperclass with functions 
that can be called without knowing the ID's of the Sharepoint Fields, 
but by using the field Display Names. 

This function is to Disable or Enable a Sharepoint PeoplePicker Field.


// call the function
// DisablePeoplePicker ("DISPLAYNAME", True) to disable the field
// DisablePeoplePicker ("DISPLAYNAME", False) to enable the field
  
function DisablePeoplePicker( titel, b_disable)
{
    $('nobr:contains("'+titel+'")').closest("td").next("td").find("div").attr("contentEditable",false);
    if (b_disable)
    {
        $('nobr:contains("'+titel+'")').closest("td").next("td").find("div").css("backgroundColor","silver");
        $('nobr:contains("'+titel+'")').closest("td").next("td").find("img").hide();
    }
    else
    {
        $('nobr:contains("'+titel+'")').closest("td").next("td").find("div").css("backgroundColor","white");
        $('nobr:contains("'+titel+'")').closest("td").next("td").find("img").show();
    }
}
 

dinsdag 8 oktober 2013

Disable a Date field without knowing the ID of your Sharepoint Field


I'm starting to write my own sharepoint helperclass with functions 
that can be called without knowing the ID's of the Sharepoint Fields, 
but by using the field Display Names. 

My first function isn't complete yet.
Disable or Enable a Date Field.
It will be completed very soon with the type "DateTime". 


// call the function
// DisableDateField ("DISPLAYNAME", "Date", True) to disable the field
// DisableDateField ("DISPLAYNAME", "Date", False) to enable the field
  
function DisableDateField (titel, type, b_disable)
{
    if (type == "Date")
 {
        $(':input[title="'+titel+'"]').attr("disabled",b_disable);
        if (b_disable)
            $(':input[title="'+titel+'"]').closest("td").next("td").hide();       
        else
   $(':input[title="'+titel+'"]').closest("td").next("td").show();
 }
}