Update the link url in the Moss 2010 to call SP.UI.ModalDialog.showModalDialog

Copy the code to "<script type="text/javascript">  var navBarHelpOverrideKey = "WSSEndUser";" :


 

<script type="text/javascript">
	var navBarHelpOverrideKey = "WSSEndUser";
	 $(document).ready(function () {     
         var span1 = $("span").filter(function () {
          return  $(this).text() == "NewIdea" && $(this).parent()[0].tagName == "A";
        })[0];
        
        if(span1)
        {
           var a = span1.parentNode;
           a.href = "http://moss/Lists/TestCustomList/NewForm.aspx?Source=http://moss";
           a.onclick = openDialog;
        }
        
    });
    
function CallBackfromDialog(dialogResult)
{
   alert(dialogResult);
}; 
   
function openDialog() {
    var options = {
        url: "http://moss/Lists/TestCustomList/NewForm.aspx?Source=http://moss",
        width: 800,
        height: 600,
        title: "New Idea",
        dialogReturnValueCallback: CallBackfromDialog,
    };

    SP.UI.ModalDialog.showModalDialog(options);
    return false;
}
	</script>


Update the link url in the Moss 2010 to call SP.UI.ModalDialog.showModalDialog_第1张图片 

Update the link url in the Moss 2010 to call SP.UI.ModalDialog.showModalDialog_第2张图片

你可能感兴趣的:(function,url,idea,2010)