Open List attachments in new tab/window

Hello Floks,

Recently one my client is looking for solution in which all the list item attachment should be open in new tab or window as they have compare more than one files simultaneously.

There is a very easy solution to make it feasible. Open you List Edit/Disp Form and add below JavaScript inside it.

 $('#idAttachmentsTable a').attr('onclick','');
 $('#idAttachmentsTable a').attr('target','_blank');

Above code remove On Click event from all of the list attachment and add target as blank.

Enjoy.. 🙂 Happy Coading… 🙂 🙂

How Value Return in Before Properties, After Properties and ListItem using EventReceiver in SharePoint2010

Event receivers are common in SharePoint development so its better to understand the data available in each events. Sometimes as a developer we jump into coding before thinking about contextual data availability.One more important thing to notice list event receiver  and document library event receiver are different items of contextual data availability.Following Table will give you a clear picture about the contextual data in each events.

  • SharePoint List

Event

Before Properties Returns

After Properties Returns

ListItem Returns

Event Type

Item Adding

Null Value

New Value

Null Value

Synchronous

Item Updated

Null Value

New Value

New Value

Asynchronous

Item Updating

Null Value

Changed Value

Current Value

Synchronous

Item Updated

Null Value

Changed Value

New Value

Asynchronous

Item Deleting

Null Value

Null Value

Current Value

Synchronous

Item Deleted

Null Value

Null Value

Null Value

Asynchronous

  • SharePoint Document Library

Event

Before Properties Returns

After Properties Returns

ListItem Returns

Event Type

Item Adding

Null Value

Null Value

Null Value

Synchronous

Item Updated

Null Value

Null Value

New Value

Asynchronous

Item Updating

Current Value

Changed Value

Current Value

Synchronous

Item Updated

Current Value

Changed Value

New Value

Asynchronous

Item Deleting

Null Value

Null Value

Current Value

Synchronous

Item Deleted

Null Value

Null Value

Null Value

Asynchronous