Showing posts with label Search List. Show all posts
Showing posts with label Search List. Show all posts

Sunday, January 06, 2013

Sharepoint Search between two dates

Searching between two dates in a list.
this is not a default view in 2003.
there are links that enable and help is understanding more about it.

in simple terms. Create 2 text boxes in form
and name them start date and end date

create parameter in data view  for start date and end date

create filter for start date and end date

set default value for start date as 1500-01-01

default value for end date as 3500-01-01 - this will display all items

connect the boxes and use the format as yy-mm-dd else it wont work
important references:


http://yanlinglei.blogspot.in/2010/02/filter-between-two-dates-using-dataview.html

http://yanlinglei.blogspot.in/2008/11/filter-between-two-dates-date-range.html


http://social.technet.microsoft.com/Forums/eu/sharepointadminlegacy/thread/a8cce2af-3900-4421-8fc0-91d9adc315ad

datepicker() modified as
datepicker({ dateFormat: 'yy-mm-dd'});

http://docs.jquery.com/UI/Datepicker/formatDate

http://stackoverflow.com/questions/7500058/how-to-change-date-format-mm-dd-yy-to-yyyy-mm-dd-in-date-picker


Text boxes sample - form webpart
------------------

<div onkeydown="javascript:if (event.keyCode == 13) _SFSUBMIT_">
<head>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="jquery-ui.css" />
    <script src="jquery-1.8.3.js"></script>
    <script src="jquery-ui.js"></script>
    <link rel="stylesheet" href="style.css" />
  
 <script>
   $(function()
     {
     $( "#datepicker" ).datepicker({ dateFormat: 'yy-mm-dd'});
     $( "#datepicker1" ).datepicker({ dateFormat: 'yy-mm-dd'});
     });
    </script>
</head>
Start Date: <input type="text" name="T1" id="datepicker" />
End Date : <input type="text" name="T2" id="datepicker1" /><input type="button" value="Go" onclick="javascript:_SFSUBMIT_"/>
</div>
</html> 

Wednesday, August 22, 2012

Show hide

<script type="text/javascript"> 

// Text to HTML 
// Feedback and questions: Christophe@PathToSharePoint.com 
// 
var theTDs = document.getElementsByTagName("TD"); 
var i=0; 
var TDContent = " "; 
while (i < theTDs.length) { 
try { 
TDContent = theTDs[i].innerText || theTDs[i].textContent; 
if ((TDContent.indexOf("<DIV") == 0) && (TDContent.indexOf("</DIV>") >= 0)) { 
theTDs[i].innerHTML = TDContent; 


catch(err){} 
i=i+1; 

 
// ExpGroupRenderData overwrites the default SharePoint function 
// This part is needed for collapsed groupings 
 
function ExpGroupRenderData(htmlToRender, groupName, isLoaded) { 
var tbody=document.getElementById("tbod"+groupName+"_"); 
var wrapDiv=document.createElement("div"); 
wrapDiv.innerHTML="<TABLE><TBODY id=\"tbod"+ groupName+"_\" isLoaded=\""+isLoaded+ "\">"+htmlToRender+"</TBODY></TABLE>"; 
var theTBODYTDs = wrapDiv.getElementsByTagName("TD"); var j=0; var TDContent = " "; 
while (j < theTBODYTDs.length) { 
try { 
TDContent = theTBODYTDs[j].innerText || theTBODYTDs[j].textContent; 
if ((TDContent.indexOf("<div") == 0) && (TDContent.indexOf("</div>") >= 0)) { 
theTBODYTDs[j].innerHTML = TDContent; 


catch(err){} 
j=j+1; 

tbody.parentNode.replaceChild(wrapDiv.firstChild.firstChild,tbody); 

</script>

Tuesday, July 24, 2012

Dynamic Search

Have fun!!

<SCRIPT type="text/javascript"src="SITE/Shared%20Documents/Lib/js/jquery-1.7.1.min.js"></SCRIPT>
<SCRIPT type=text/javascript>
jQuery(document).ready(function($){
    //attach a function to the keyup event on the filter box
    $('#filterInput').keyup(function()
    {
        DynamicFilter($('#filterInput').val());
    });
})
//strip off html taqs
function stripHTML (field) {
    return field.replace(/<([^>]+)>/g,'');
}
function DynamicFilter(text)
{
    //find out list view (default class for a listview is "ms-listviewtable"
    $('table [class="ms-listviewtable"]').find('tr').each(function()
        {
            //don't filter out the header row
            if ($(this).attr("class") != "ms-viewheadertr ms-vhltr")
            {
                //get the html for the row and strip off the html tabs
                source = stripHTML($(this).html());
               
                //check to see if the filter text exists in the remaining text
                if (source.indexOf(text) < 0)
                {
                    //hide the row if it doesn't contain the text
                    $(this).hide();
                } else {
                    //otherwise show it
                    $(this).show();
                }
            }
        }
    );
}
</script>
<div id="mainDiv">
    <table>
        <tr>
            <td class='Filter' width='125px'>Search: <input type="Text" id="filterInput" ></td>
        </tr>
    </table>
</div>

Followers

No Locks without Key

🌿 Bible Verse 1 Corinthians 10:13 "No temptation has overtaken you except what is common to mankind. And God is faithful; ...

Who Am I?

My photo
What is mankind that you are mindful of them, human beings that you care for them? Psalms 8:4 But he made us a little lower than Angels and Crowned with Glory and Honor. How majestic is your name in all the Earth Oh Lord our God!