You must Sign In to post a response.
  • Category: Sharepoint

    Jquery for sharepoint

    <script type="text/javascript" src="../SiteAssets/Script/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="../SiteAssets/Script/jquery.SPServices-0.7.2.min.js"></script>
    <style type="text/css">
    #Hero-WPQ2{
    display:none!important;
    }
    #CSRListViewControlDivWPQ2{
    display:none!important;
    }
    </style>
    <style type="text/css">
    table.ms-toolbar{ display:none; }
    #s4-ribbonrow { display : none; }
    </style>

    <style type="text/css">

    </style>
    <script type="text/javascript">
    $(function(){


    $("input[name='btnNew']").click(function(){
    var url = $().SPServices.SPGetCurrentSite()+"/Lists/lstRequest/Request.aspx";
    launchModal(url,"New Request")
    });

    $("input[name='btnUpdate']").click(function(){

    var id = GetSelectedItemID();
    if(typeof(id) == 'undefined')
    {
    alert("Please select at least one request..");
    }
    else if(id == false)
    {
    alert ("Please select only one request..");
    }
    else if(id > 0)
    {
    var url = $().SPServices.SPGetCurrentSite()+"/Lists/lstRequest/EditRequest.aspx?ID="+id;
    launchModal(url,"Edit Request")
    }
    });


    function GetSelectedItemID()
    {
    var id, count =0;
    $('.s4-itm-cbx.s4-itm-imgCbx').each(function() {
    if($(this).attr("aria-checked")== "true")
    {
    id = $(this).attr("title");
    count += 1;
    }
    });
    id = (count > 1 ? false : id);
    return id;
    }

    function OpenDialog(pageUrl,pageTitle) {
    var ModalDialogOptions = { url: pageUrl, showClose: true, allowMaximize: true,title:pageTitle};
    SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', ModalDialogOptions);
    }

    function launchModal(pageURL,pageTitle)
    {
    var options = SP.UI.$create_DialogOptions();
    options.title = pageTitle;
    options.url = pageURL;

    options.dialogReturnValueCallback = Function.createDelegate(null, refreshParent);
    SP.UI.ModalDialog.showModalDialog(options);
    }

    function refreshParent(result, target) {
    if(result == 1) window.parent.location = window.location.href;
    }

    });
    </script>

    <table width="100%" border="0" cellspacing="0" cellpadding="4">
    <tbody>
    <tr>
    <td class="ms-vb" nowrap="">
    <input name="btnNew" type="button" value="New Request">
    </td>
    <td class="ms-vb" nowrap="">
    <input name="btnUpdate" type="button" value="Update Request">
    </td>
    <td width="99%" class="ms-vb" nowrap="">
    <input name="btnDelete" onclick="javascript: __doPostBack('ctl00$PlaceHolderMain$g_9094cff9_1592_4f84_8c66_87fe57096f55','__cancel')" type="button" value="Delete Request">
    </td>
    </tr>
    </tbody>
    </table>
  • #749562
    hi
    vasu

    Refer this url


    http://www.sharepoint-journey.com/jquery.html
    http://www.codeproject.com/Articles/544538/JQuery-with-SharePoint

    PDF file this

    http://www.sharepointbham.org/Presentations/SharePoint%20and%20jQuery.pdf


    Name : Dotnet Developer-2015
    Email Id : kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.


  • Sign In to post your comments