Posts

Showing posts with the label Jquery

Creating custom events for a control in HTML

Hi All, Sometimes we need to create a custom event for a control which we can use it to get the context of the control.Below is a quick method using jQuery to do that. In the below example i have created an init method for input tag. This method can be simply trigger using   $(<SELECTOR>).trigger("<METHODNAME>") Example  <input id="txtName" class="news" init="initializeSection1" />     <input id="txtName" class="news" init="initializeSection2" />     <script>         $(document).ready(function () {             $(".news").bind("init", function (e, data, val) {                 var initializeFunctionName = $(this).attr("init");                 window[initializeFunctionName](e, data, val);             });             $...

SharePoint 2010 List View Header Count of Rows

Hi All, Sometimes we need to show the number of rows in the header itself when we have created an accordion on the webpart header.below is the code which helps us display count of the rows. $(".s4-wpTopTable").each(function(){ var countOfRows=   $(this).find(".ms-listviewtable").find("tr .ms-vb2:first-child").length;   $(this).find(".ms-WPTitle a span:first-child").append("<b> (" + countOfRows + ")</b>"); }) ; Edit: ID column is needed in the list view to display the count.Working on it so that this can be eliminated.

SharePoint Ribbon Customisation

Below are the two reference of SharePoint ribbon customisation which i found interesting. http://www.umtsoftware.com/blog/creating-sharepoint-ribbon-elements-in-javascript/ http://spevilgenius.blogspot.in/2013/10/creating-ribbon-tabs-and-buttons-in.html

OOTB Export to Excel using JSOM SharePoint 2010

Well sometimes we think that we could leverage OOTB Export to Excel option in our custom pages. With below JSOM code we can

Jquery Tabs Plugin

Hi Folks, Just in my free time i was looking around for some tab jquery plugins. I found many with some very cool features. Now here a cool jquery plugin which has the following features. 1. Simple layout. (Does not require Jquery UI tabs html) 2. Can work on any tab switch. 3. Can apply custom styling Upcoming features 1. Alternate Animation (Currently supports only fade) 2. Call backs 3. Responsive to screen resolution 4. Support for Firefox and Chrome Example of HTML <a  href="#" value="tab1" isTabSwitch='true'  >Tab1</a> <a   href="#"  value="tab2" isTabSwitch='true' >Tab2</a> <a   href="#" value="tab3" isTabSwitch='true' >Tab3</a> <div id="tab1"   isTab='true' > First Tab </div> <div id="tab2"  isTab='true'> Second Tab </div> <div id="tab3" isTab='tru...

Input Navigation Jquery Script

Sometimes if a form in a webpage has too many input field controls (Text boxes) it becomes unfriendly to navigate between them. We sometimes feel that navigation between text boxes be as simple as navigating between cells in Spreadsheet. This Jquery Script allows you to navigate through text boxes just like spreadsheet cells making the User Interface more user friendly and easing the navigation. Click here to get the  Input Navigation Script Bonus: Along with navigation the script file contains a function for select all header check box. :) Currently this script is in beta version.

Numeric Textbox Jquery Plugin

Many times we struggle with numeric validations on an input box. Here is a numeric simple textbox plugin. Though i have made sure all the validation occur on keypress some of the validation occur onblur event. This plugin can be improved by your suggestions.They are always welcome. Features : 1. Configurable Number of digits after decimal 2. Configurable Negative Numbers 3. Changes background Color of the input box incase of validation. Usage:  $("[isNumeric='true']").NumericTextbox({ NoOfDigitsAfterDecimal: 2, AllowNegativeNumbers: false });    <asp:TextBox ID="txtNumeric" runat="server" Text=".." isNumeric="true"></asp:TextBox> Click here to download  Numeric Text box Plugin