Cizi

From the desktop of SharePoint girl

Changing the Edit link of SharePoint Data Views

This is the last post in the series about changing the links (delete, insert and edit). Finally, I'm here to talk about changing the Edit link.

How to…

   Replace each "BLOCKED SCRIPT" to:

The original edit links allows the user to update the data in the data view.

1.OriginalEdit

The link looks like that:

<a href="BLOCKED SCRIPT {ddwrt:GenFireServerEvent(concat('__cancel;dvt_1_form_editkey={',$KeyValue,'}'))}">edit</a> 

Here we also have 2 options to edit the link.

Option 1: Link to EditForm.aspx

<a href="http://<site name>/Lists/Contacts/EditForm.aspx?ID={@ID}&amp;CancelSource=http://<site name>/Pages/YourPage.aspx&amp;Source=http://<sitename>/Pages/YourPage.aspx"><img src="../PublishingImages/Edit.gif" border="0"></img></a> 

Notice:

  1. I'm using here, as in the previous post, in the CanacelSource and Souce parameters, with full path, in order to prevent the users from visit AllItems.aspx.
  2. I'm using ID parameter, in order to direct the user to the EditForm.aspx with the correct data.

Option 2: Insert another JS function <!-- Again, my favorite option -->

For this one we will need the IE developer toolbar as well. Steps:

  1. Display any of your items (DispForm.aspx ). In the tool bar you will find the Edit Item link (next to New Item).
  2. Open the IE developer toolbar and Click Select element by click.

3.SelectElementByClick

  1. Click on the edit link(1), find the a class named ms-toolbar (should be under the second td), copy the href and onclick attributes.

2.CopyTheEditLink

The link should looks like that:

 <a href="http://demosrv/Lists/Contacts/EditForm.aspx?ID={@ID}" onclick="GoToLink(this);return false;"><img src="../PublishingImages/Edit.gif" border="0"></img></a> 

Notice:

  1. I'm using ID parameter, in order to direct the user to the EditForm.aspx with the correct data.
  2. I added the onclick attribute after the link.

Finally, this was the last post in the series, and I hope it was helpful.

Inbar

Comments

name said:

So where it to find,

# July 29, 2009 2:26 PM

name said:

I like it so much,

# July 29, 2009 9:39 PM

JXL72 said:

According to their website The All-Sinatra format aired throughout the month of September. ,

# October 22, 2009 5:43 PM

Stinky61 said:

This makes it a matter of far more than antiquarian   interest whether past philosophers are being correctly understood and   whether revisions and modifications of their views are well-motivated   or merely the result of misreadings and distortions, blinkered through   the influence of intervening prejudices. ,

# October 23, 2009 3:13 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: