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

来源:互联网 发布:反对本本主义 知乎 编辑:程序博客网 时间:2024/06/05 10:09

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>


 

原创粉丝点击