0

I'm creating a solution using SharePoint 2010 that contains a list (list1) with a lookup column (list2_column) to another list (list2). The main view for list1 is grouped by list2_column. Both lists were created with NavigateForFormsPages="TRUE".

So my list view might look like this:

+ list2_column: some_item (3)
    [ ] list1_item1
    [ ] list1_item2
    [ ] list1_item3

The problem I'm having is that when the user clicks on some_item, SharePoint opens up the display form for the item in a modal dialog. Is there any way to prevent this from happening?

P.S. If it makes any difference, everything in my solution is created during the FeatureActivated event.

EDIT: Turns out what I was trying to do is possible by building on Ksesh's answer a little:

<a href="{substring-before(substring-after($thisNode/@*[name()=current()/@Name], 'href=&quot;'), '&quot;')}">
<xsl:value-of select="substring-before(substring-after($thisNode/@*[name()=current()/@Name], '&gt;'), '&lt;')" />
</a>

This makes a link without the onclick event that opens the modal dialog. But seeing as how I have quite a few list views showing mostly lookup columns, all opening in dialogs, I think it's going to be easier to do what I want in jQuery. Something like this should do the trick:

$('table.ms-listviewtable a[onclick]').removeAttr('onclick');
0

You can do followwing. In spd open your view, go to the lookup value <xsl:value-of> tag $thisNode/@*[name()=current()/@Name] and change it to

substring-before(substring-after($thisNode/@*[name()=current()/@Name],'>'),'<')

This will disable model dialog for this lookup column totally in this list view.

more detail

  • Thanks, that's pretty much what I needed. Now I just have to figure out how to remove the onclick from the link instead of the whole tag, and how to automate the process during deployment instead of using spd. – Jez Aug 1 '12 at 4:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.