Online JavaScripts library launched

Filed Under (JavaScript, SharePoint) by Boris Gomiunik on 01-03-2010

When dealing with quite some scripts for this blog or at work, I always come across couple of supporting JavaScripts that I constantly reuse. That’s why I’ve created an extra page to publish those scripts and have them available at one place. And if you find some use for them, so much the better.

Those scripts are just thrown there for now – all undocumented and some even borrowed from other pages. The library will be expanding as I create / come across new scripts.

Hope you find them useful.

Click here to see the JavaScript Library

Technorati Tags: ,

Power of CEWP series: Selecting objects in SharePoint DOM

Filed Under (JavaScript, SharePoint) by Boris Gomiunik on 21-02-2010

The second article from the series Power of Content Editor WebPart is published. It’s titled Getting to the object. It’s a sequel from the first article and in this part we learn how to use some of JavaScript’s native functions to select the element we wish to modify in SharePoint. We also make a simple demo of enabling HTML tags in a list description. You’re welcome to read it and please leave all your question and comments in this post’s comments.

Just as a side note, I began preparing this series as a presentation for SPSEMEA. You can find recordings from this fantastic online event here.

Technorati Tags: ,

Create Cascaded (related) Lookup Dropdown fields easy with no server deployment

Filed Under (JavaScript, SharePoint, SharePoint Lookup field) by Boris Gomiunik on 17-02-2010

I’ve added a new section on my page dedicated to JavaScript solutions that I’ve published. The latest one is intended for creating a Cascaded Lookup Dropdown fields in a SharePoint New or Edit Form.

What is a Cascaded dropdown? It’s a combination of two dropdown lists. By selecting an option in the first dropdown (parent) you filter the options in a second dropdown (child).

Using this simple-to-deploy and configure solution you can create multiple cascaded relations in the same form. It works in MOSS 2007 / WSS 3.0 and in MOS 2010 / WSF 4.0

You can visit the project page here or download the JavaScript solution from CodePlex.

The quick way to get to know the internal name of the SharePoint Column

Filed Under (JavaScript, SharePoint) by Boris Gomiunik on 16-02-2010

If you need to know the internal name of a SharePoint column (which can be pretty different from actual if you’re using spaces and latin characters, you can discover this very simple:

  1. Go to list’s settings and edit the properties of the field (on a sample below we’ll get to know the internal name of a "Business phone" column in a standard Contacts list:
    image
  2. In the URL of the "Change Column" page, look for "Field=…" at the end:
    image  
  3. In the example above, the internal name is WorkPhone. But if your column name contains strange characters, like e.g. Hello%5FWorld%5Fx0020%5FColumn (which we would get if we created a "Hellp_World Column" column, type the following in the URL bar of your Web Browser:
    javascript:unescape(‘[your-field-name]‘)
    and press enter. You’ll get the internal name of the field:
    image

Why is internal column name good for? XSLT views code in SharePoint Designer, Querying SharePoint Web Services, custom scripts, when programming backend against a SharePoint list or list item,…

Power of Content Editor WebPart article series started

Filed Under (JavaScript, SharePoint) by Boris Gomiunik on 08-02-2010

Feedback from SharePoint Saturday EMEA online still brings good results. Not only did it make me cleanup quite some of my JavaScripts to prepare for presentation, but it also inspired me to start the "The Power of Content Editor WebPart" series of articles. It’s going to be an at-least 10-part series. Covering from basics to a bit more in-depth on how to use JavaScript to

  1. Change the looks of SharePoint pages
  2. Add features and functionalities to SharePoint Pages and list forms
  3. Read from and write data to SharePoint Lists using SharePoint’s Web Services.
  4. Some other stuff we’ll come along on the way

If you wish to know what all we’ll be getting to know there are already all examples explained in my previous post.

Starting off easy we learn how to insert the CEWP also in pages where the "Edit Page" command in "Site Actions" is not available.

You can find the series article here: The Power of Content Editor WebPart.

As soon as new content is added, I’ll be letting you know.

SPSEMEA Demo site and showcase

Filed Under (JavaScript, SharePoint, jquery) by Boris Gomiunik on 03-02-2010

I’ve prepared a SPSEMEA Demo site that you can simply upload to your (http://[siteUrl]/_catalogs/wt) Site template gallery.

You can download the .stp from CodePlex

After you’ve uploaded the file to the Site template gallery you can create a subsite (English language) and from Custom you can select the uploaded template.

Below’s a brief overview where you can find tricks. How it’s done – check for Content Editor WebParts in that page (using a “PageView=Shared&ToolPaneView=2” parameters in url (more info here)). All the files containing code are in a document library Sys.

image

Let’s see the samples:

Read the rest of this entry »

SharePoint Lookup field: how does it work and how to add JavaScript event handler function to it?

Filed Under (JavaScript, SharePoint, SharePoint Lookup field) by Boris Gomiunik on 26-10-2009

Due to a lot of comments and questions to my last year’s post about Attaching functions to SharePoint form fields concerning especially lookup fields on which the demo was made, I’ve decided to take a deeper dive into SharePoint’s Lookup Field and how to manipulate it client-side, since it behaves different in different situations. On the image below you can see two lookup fields – rendered different.

image

Even though new SharePoint is about to go public beta I’ll still show how to handle this in SharePoint 3.0 or 2007

Read the rest of this entry »

ads
ads
ads