I want to create a custom column in sharepoint 2010. When it is added to a list view I need it to render a link that when clicked opens a sharepoint modal dialog using the client ui. I need to pass the Itemid to the modaldilaog that is opened. Is this possible?

All the best

  • I doubt this is possible. Not using basic a basic Sharepoint list. You would need some JavaScript to accomplish this. Even if you could get the function call into the link (which I also doubt). I don't think there is any way to include the Javascript. You could do this if you wrote a custom page and web part. – user879 Dec 8 '10 at 8:58

Yes, I think this is possible - but complicated. The tricky bit will be controlling rendering in the list view, but Hyperlink fields appear as, well, hyperlinks - and I don't see why you couldn't then put your javascript into the HREF.

It doesn't feel right, however. You're not really setting/storing a value there. It sounds more like a Calculated Column. Have you tried those?

If this is to show extra details about the item, have you considered adding another web part to the View form? Something like this, but showing data from your dialog?

|improve this answer|||||

You can use computed field, for example field LinkTitleNoMenu can be rendered as

<Field ID="{bc91a437-52e7-49e1-8c4e-4698904b2b6d}" Type="Computed" Name="LinkTitleNoMenu" DisplayName="FieldName"  DisplayNameSrcField="Title" AuthoringInfo="$Resources:core,Linked_Item;" SourceID="http://schemas.microsoft.com/sharepoint/v3" ReadOnly="TRUE" >
      <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title"/>
      <FieldRef ID="{9d30f126-ba48-446b-b8f9-83745f322ebe}" Name="LinkFileNameNoMenu"/>
          <LookupColumn Name="FSObjType"/>
          <Field Name="LinkFilenameNoMenu"/>
          <HTML><![CDATA[<a onfocus="OnLink(this)" href="]]></HTML>
          <HTML><![CDATA[" onclick="GoToLink(this);return false;" target="_self">]]></HTML>
          <Column HTMLEncode='TRUE' Name="Title" Default='$Resources:core,NoTitle;'></Column>
            <HTML><![CDATA[<img src="/_layouts/[%=System.Threading.Thread.CurrentThread.CurrentUICulture.LCID%]/images/new.gif" alt="]]></HTML>
            <HTML><![CDATA[" class="ms-newgif" />]]></HTML>
|improve this answer|||||

Your Answer

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