Browse by Tags

All Tags » JavaScript (RSS)

Quickly filter a List/Document Library View using URL

This one's very useful when you're having a lot of items in a list or document library and you need a quick filter. If you'll select the filter field it can happen that it will load for a long time. So lately I'm using URL. Suppose you Read More......( read more ) Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks
Posted by SharePoint Blogs
Filed under: ,

Adding Flash animation in SharePoint Blog and other lists pt. 2

This post continues the topic from my first part about embedding Flash videos in SharePoint Blogs where we've learned how to embed one Flash animation or video (or have a lot of work for publishing each flash). The problem arises if we want to embed Read More......( read more ) Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks
Posted by SharePoint Blogs
Filed under: , ,

Adding Flash animation in SharePoint Blog and other lists pt. 1

SharePoint's rich text field is much better than in version 2.0. It even enables to edit the HTML source. But one thing I don't understand is why it filters out the HTML code so much that we can't even embed the Flash animations or videos Read More......( read more ) Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks
Posted by SharePoint Blogs
Filed under: , ,

Refferencing Hours and Minutes dropdown on "Date and Time" field with JavaScript

I've already posted on how to refference SharePoint field with JavaScript ( here - with functio getField ). For "Date and Time" type of fields you can use the above function only to refference the Date part. Thanks to Erik / Tanker who commented Read More......( read more ) Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks
Posted by SharePoint Blogs
Filed under: ,

Image Changes on Hover

It sees there are a lot of large javascript samples out there to change an image source on mouse over, but they all seem overly complex.  Here's a little one I made recently for a project I was working on: <script> function imgHover(imgObj,imgSrc){     imgObj.src=imgObj.getAttribute(imgSrc); } </script> And here's some HTML to demonstrate how to use it: <img     src=" /PublishingImages/main.jpg"     out=" /PublishingImages/main.jpg"     over=" /PublishingImages/main_01.jpg"     onmouseover="java-script:imgHover(this,'over');"     onmouseout="java-script:imgHover(this,'out');"     alt=""     border=0 /> Change the "java-script" and remove the "-" to make it work... It won't show up on the blog post otherwise (it tries to run it).  I've found it easiest to just embed the script in the master page, then I can use img tag with the extra attributes on any page in my site I want... Posted on SharePoint Blogs Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks
Posted by SharePoint Blogs
Filed under: , ,

Adding category titles to Blog sites (category.aspx)

I recently found an application of the Blog template that was a great fit, but needed the Category title listed on the top of the page when you click a category from the default page.  Normally, it is not visible anywhere except in the URL as a parameter, and in the categories of the posts listed.  The primary content of the page is displayed by a ListViewWebPart embedded in a table in the aspx file.  It starts like this: <table cellpadding=0 cellspacing=0 style="padding: 5px 10px 10px 10px;">            <tr>             <td valign=top>                 <WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="Left" Title="loc:Left"><ZoneTemplate> <WebPartPages:ListViewWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{973762DE-3C5C-47B0-B80C-895B16BEDD6E}" > <WebPart xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns=" http://schemas.microsoft.com/WebPart/v2" >   <Title>Posts</Title>   <FrameType>None</FrameType>   <Description>Use the Posts list for posts in this blog.</Description>...
Posted by SharePoint Blogs
Filed under: , ,

Using Cookies with SharePoint's Data View

In my previous post I've explained how to pass parameters from URL to use in a Data View. There is another very useful way: - using Cookies. The process is very similar, using SharePoint Designer: 1. To read the cookie value and use it as a parameter Read More......( read more ) Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks
Posted by SharePoint Blogs
Filed under: ,

SharePoint Pro Online Live Event Today!

Wow, this event was extraordinarily useful! From Document Management and Office integration to Features Building and AJAX Web Parts. They had it covered. Very impressive. If you are interested in MOSS 2007 at any level you should check out the recorded sessions at http://events.unisfair.com/rt/sharepoint~oct07 . Posted on SharePoint Blogs Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

Great tools for web developers pt. 3

The third in the series of tools for web developers is for the ones that don't want or don't have the option to install any software or addons and just need a quick access to a tool for inspecting DOM 1. Mouseover DOM inspector v. 2 - MODIv2 This Read More......( read more ) Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

Great tools for web developers pt. 2

In my previous post I've presented a tool that I find very useful when debugging display, creating javascript related to HTML DOM, etc. The tool is intended for Internet Explorer. The FireFox users aren't deprived of such tools either. There are Read More......( read more ) Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

Great tools for web developers pt.1

Many times to refference or change the the element's properties in a DOM of a web page, I was just going crazy. Especially in SharePoint this can be difficult, because some elements are nested DEEP within other elements (table > div > div > Read More......( read more ) Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

Custom Web Part Code: Adding the default doc lib menu to a custom web part

So I found a way to add the default drop down menu to the items of a custom web part control. Its pretty convoluted, so if you form a more direct way let me know. See code below: This Template is needed to be instantiated, but we don't render it... (lil trick) msaListMenu = new MenuTemplate(); msaListMenu.ID = "DocLibMenu"; I use this menu column to expose multiples values I need for the menu: SPMenuField msaColMenu = new SPMenuField(); msaColMenu.HeaderText = "Name"; msaColMenu.TextFields = "FileLeafRef, ID, COUID"; //msaColMenu.TextFormat = "{0}/{1}/{2}"; msaColMenu.MenuTemplateId = "DocLibMenu"; //msaColMenu. msaColMenu.NavigateUrlFields = "FileLeafRef";//Client_x0020_Name_x0020_2"; msaColMenu.NavigateUrlFormat = SPContext.Current.Web.Url+"/[Doc Library Name]/1/{0}";//1 msaColMenu.TokenNameAndValueFields = "EDIT=ID,NAME=Title,TYPE=DocIcon,REF=FileLeafRef"; msaColMenu.SortExpression = "Title"; msaGrid.Columns.Add(msaColMenu); Javascript I implanted directly after the rendering of the SPGridView Control (this javascript manipulates the menu field that we put in our SPGridView control and gives it the identical html that the default web parts use for their menus: string transplantMenuFunction = ""; transplantMenuFunction += "<script>\n"; transplantMenuFunction += "function transplantMenu(){\n"; transplantMenuFunction += " var error;\n";...

Best Practices in Javascript Library Design

Last night, I'd the chance to look at John Resig 's talk on the Best Practices in Javascript Library Design . This talk explores all the techniques used to build a robust, reusable, cross-platform JavaScript Library. We’ll look at how to write a solid JavaScript API, show you how to use functional programming to create contained, concise, code, and delve deep into common cross browser issues that you’ll have to solve in order to have a successful library. John Resig is a JavaScript Evangelist, working for the Mozilla Corporation, and the author of the book ‘Pro Javascript Techniques.’ He’s also the creator and lead developer of the jQuery JavaScript library and the co-designer of the FUEL JavaScript library (included in Firefox 3). jQuery - that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to our web pages. Fuel - Firefox User Extension Library - is a JavaScript Library designed to help developers build extensions using terminology and interfaces that are familiar to them. It will be usable in Firefox 1.5-3.0. Download jQuery Download jQuery 1.2.1 (14kb, Minified and Gzipped ) Great for production use. Download jQuery 1.2.1 (77kb, Uncompressed) Great for testing, learning and development. Download jQuery 1.2.1 (26kb, Packed ) For those that can't Gzip their JavaScript. Posted on SharePoint Blogs Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks
Posted by SharePoint Blogs
Filed under:

Custom Web Part Code: Deleting an Item

So this works, but if anyone has any brighter ideas, I have open ears... I was creating a document library web part and had to recreate some of the functionality in the menu... So here is the way I delete and Item... Declare and initialize a hidden field to store the id of the element to be deleted... hfDeleteDoc //Server Side Function (C#) private Boolean deleteDoc(int ID){ try { if (msaListName != null && msaListName != "") { SPContext.Current.Web.Lists[msaListName].Items.DeleteItemById(ID); } return true; } catch { return false; } } //Server Side Code (C#) if (hfDeleteDoc.Value != "") { int id = Convert.ToInt32(hfDeleteDoc.Value); deleteDoc(id); hfDeleteDoc.Value = ""; } //Server Side Code (C#) Building a javascript function for your menutemplate string deleteDocFunction = ""; deleteDocFunction += "<script>\n"; deleteDocFunction += "function deleteDoc(docID){\n"; deleteDocFunction += " var hfDeleteDoc = document.getElementById('" + hfDeleteDoc.ClientID + "');\n"; deleteDocFunction += " hfDeleteDoc.value = docID;\n"; deleteDocFunction += " document.forms[0].submit();\n"; deleteDocFunction += "}\n"; deleteDocFunction += "</script>\n"; writer.Write(deleteDocFunction); //Server Side Code (C#) Creating a template for your menu msaListMenu = new MenuTemplate(); msaListMenu.ID = "MSAListMenu"; MenuItemTemplate msaListMenuItem1...

Become Presence Aware with your WebParts with just an email!

Okay so I found some great info on this site about presence aware stuff: http://blogs.msdn.com/modonovan/archive/2005/05/11/416376.aspx Now, this site exposes a sample CAML for the schema.xml file for a particular list web part... However if you decifer this a bit you will get to the core html for the presence aware feature: <table> <tr> <td> <table cellpadding="0" cellspacing="0"><tr><td style="padding-right: 3px;"><img border="0" valign="middle" height="16" width="16" src="/_layouts/images/blank.gif" onload="IMNRC( 'a@b.c' )" ShowOfflinePawn=1><td></tr></table> </td> <td> <a href=" mailto: a@b.c"> name </a> </td> </tr> </table> This presence aware html code will allow users to check for an outlook schedule, go to a my site, or see if the target user is online(Microsoft Communicator)... This is a really great feature and its so simple... In your web parts just display render the html to the screen and substitute in an email address and a name. I'm going to use this to make Account Managers presence aware on their clients sites, and when an user search for a client, the results will include the account managers for the client and they will be presence aware. It really is an exciting feature for the clients, they get very excited about it. So test this out on your sharepoint...
More Posts Next page »