Usefulscripts.files.wordpress.com



<link rel="stylesheet" type="text/css" href=""><script type="text/javascript" src=""></script><script type="text/javascript" src=""></script> <h2>SharePoint 2013: JQuery Data Table Demo.</h2><h3>This is a quick sample to demonstrate calling a custom SharePoint-hosted WCF REST service from a Script Editor Web Part using simple HTML, JavaScript and JQuery and show the result in a jQuery Data Table Widget.</h3><div> <br /> <p id="message">Loading presidents...</p></div><div id="resultsPanel"><table width="100%" class="display" id="example" cellspacing="0"> <thead> <tr> <th>Id</th> <th>FirstName</th> <th>LastName</th> <th>EmailAddress</th> </tr> </thead> <tfoot> <tr> <th>Id</th> <th>FirstName</th> <th>LastName</th> <th>EmailAddress</th> </tr> </tfoot> </table></div><script type="text/javascript"> $(document).ready(function () { getPresidentsData(); }); function getPresidentsData() { var serviceUri = ""; $.ajax({ type: "GET", contentType: "application/json", url: serviceUri, dataType: "json", success: function (response) { showPresidentsList(response); $('#message').html("<a href=" + serviceUri + ">" + serviceUri + "</a>"); }, error: function (err) { alert(err); } });}function showPresidentsList(presidentsData) { $('#example').DataTable( { data: presidentsData, "aoColumns": [{ "mData": "Id" },{ "mData": "FirstName" },{ "mData": "LastName" },{ "mData": "EmailAddress" } ] } );}</script> ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download