Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a list called Contact, where I have three fields , 1. Name 2. Mobile 3. Email.

Now I created a Content Editor, Where I will display all the names of the employees. Now how can I create a pop up box (Like the one we will get from this site) to show the Mobile and Email of the selected users.

Thank you for all the help!!

share|improve this question
    
Are you using a Content Query Webpart instead of a Content Placeholder? –  Daniel Butler Nov 3 '11 at 6:00
    
@DanielButler I apologize it is Content Editor!! –  Jithu Nov 3 '11 at 6:59
    
How are you retreiving the list items so far, is it by the client side object model? –  Daniel Butler Nov 3 '11 at 7:11
    
Currently I created a gridview to get all the list items and show as a visual webpart.. Now here I am asking I will manually add the Employee name (only 5 members) in a Content Editor and on click of each employee can I show his Other details from the list (such as Mobile and Email) in a dialogue / pop up box ? –  Jithu Nov 3 '11 at 7:18

2 Answers 2

up vote 5 down vote accepted

You probably should use the SharePoint Modal Dialog Framework to display it.

The easiest way would be:

  • Create a view with the fields you would like
  • View an contact from the list, right click and select Properties on the page to obtain the URL
  • Copy the Content ID and fix the URL relative to your page into the following function
  • Modify the page where you are displaying the list of ids with a URL of openContactDialog()

    function openContactDialog(listItemId) {
        var options = {
            url: "../../Lists/Contacts/DispForm.aspx?ContentTypeId=<INSERT ID FOR VIEW HERE>&IsDlg=1&ID=" + listItemId,
            width: 800,
            height: 600,
            title: "Contact Information",
        };
        SP.UI.ModalDialog.showModalDialog(options);
    }
    

To call the function from the GridView, use the following as an example:

<asp:GridView ID="gv" runat="server" AutoGenerateColumns="false">
        <Columns>
            <asp:TemplateField HeaderText="Employee">
                <ItemTemplate>
                    <a href="javascript:openContactDialog('<%# Eval("Id") %>');"><%# Eval("Name") %></a>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
share|improve this answer
    
Thank you for this detailed info, let me try with this. Since I am a very new programmer everything looking so difficult !! –  Jithu Nov 3 '11 at 7:20
    
Thanks Dan, working great !! –  Jithu Nov 3 '11 at 11:18

Do you mean popup box = tooltip window? :) There are actually plenty of jquery tooltip plugins, you can use any of them.

share|improve this answer
    
That was a great link Omlin, However how can I add this to my Content editor webpart? Its like a dialogue box !! –  Jithu Nov 3 '11 at 7:00
    
You can edit HTML code in Content Editor WebPart. Search for HTML button on ribbon. –  Andrey Markeev Nov 3 '11 at 7:19
    
Thank you for that info, Let me try !! –  Jithu Nov 3 '11 at 7:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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