Wednesday, November 21, 2012

search through keyevent

 /*
     $("#clickMe").click(function(){
                sF.presentForm("<div>I am presented</div>");
        })
*/
    // _spBodyOnLoadFunctionNames.push("JsonCallwithOneParameter");
     function JsonCallwithOneParameter()
     {
   var htext = ""; 
   htext += "<link rel='stylesheet' type='text/css' href='../JQUERYFiles/jTPS.css' />";  
   htext += "<table id='demoTable' style='border: 1px solid #ccc;' cellspacing='0' width='700'>";
   htext += "   <thead>";
   htext += "  <tr>";
   htext += "   <th sort='description'>Room Type</th>";
   htext += "   <th sort='beds'>Beds</th>";
   htext += "   <th sort='maxGuests'>Occupancy</th>";
   htext += "   <th sort='average'>Nightly Avg</th>";
   htext += "  </tr>";
   htext += " </thead>";
   htext += " <tbody>";
   htext += "  <tr>";
   htext += "   <td>1 Bdrm Condo K (96 left)</td>";
   htext += "   <td>1</td>";
   htext += "   <td>4 max</td>";
   htext += "   <td>$169.00</td>";
   htext += "  </tr>";
   htext += "  </tbody>";
   htext += "  <tfoot class='nav'>";
   htext += "    <tr>";
   htext += "     <td colspan=7>";
   htext += "      <div class='pagination'></div>";
   htext += "      <div class='paginationTitle'>Page</div>";
   htext += "      <div class='selectPerPage'></div>";
   htext += "      <div class='status'></div>";
   htext += "     </td>";
   htext += "    </tr>";
   htext += "   </tfoot>";
   htext += "</table>";
  
   document.getElementById('feedContent').innerHTML = htext;
      }
  function searchpressed(){
 
   var sSearch = document.getElementById('txtSimpleSearch')
   document.getElementById('msg-keypress').innerHTML = sSearch.value;
    //GetFastResources
   var productURL = "http://win-n9fdqlp6lvb:8001/sites/CRManagement/_vti_bin/CSSharePointServices/ContractResourceClassSVC.svc/GetFastResources";
   var entry = {"name":""+ sSearch.value+""};

         $.ajax({
             type: "GET",
             url: productURL,
             data: entry,           
             contentType: "application/json; charset=utf-8",
             dataType: "json",
             //cache: false,
             complete: processobjresult,

             
             error: function () {
           //debugger;
                 alert('error second');
             }
         });

  }
  

Wednesday, November 14, 2012

Create a simple WCF in SharePoint

Create a Simple WCF in SharePoint
http://scottcurrier.wordpress.com/2010/07/28/simple-wcf-service-within-sp2010-note-to-self/

JSON, parseJSON
http://api.jquery.com/jQuery.parseJSON/
var obj = jQuery.parseJSON('{"name":"John"}');
alert( obj.name === "John" );
 

Got REST? Querying SharePoint List data using REST services client-side: Part 1 
https://www.nothingbutsharepoint.com/sites/devwiki/articles/Pages/Got-REST-Querying-SharePoint-List-data-using-REST-services-client-side-Part-1.aspx


Got REST? Querying SharePoint List data using REST services client-side: Part 2
https://www.nothingbutsharepoint.com/sites/devwiki/articles/Pages/Got-REST-Querying-SharePoint-List-data-using-REST-services-client-side-Part-2.aspx
 
  
Overview of using REST in SharePoint 2010
http://www.synergyonline.com/blog/lists/posts/post.aspx?id=35

REST-Based Ajax Services with WCF in .NET 3.5
http://www.code-magazine.com/Article.aspx?quickid=080014

JQUERY DataTable
http://www.overset.com/2008/08/30/animated-sortable-data-table-jquery-plugin--jtps/