More in this section

Forums / Developing with Sitefinity / JQUERY dialog in custom module Sitefinity 5.0

JQUERY dialog in custom module Sitefinity 5.0

2 posts, 0 answered
  1. Waseem
    Waseem avatar
    24 posts
    Registered:
    31 Jul 2012
    23 Apr 2012
    Link to this post
    Hi,
    I have created a custom module (Sitefinity 5.0) where I am displaying employee information along with employee picture.
    I want to show a dialog with text field and text box while click on employee picture. My click function is working fine and it is showing me the alert that picture has clicked, but i dont know how to create and show dialog with JQUERY.
    Could please anyone help me in this matter. Following is my code snippet

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="OpenAccessDataProvider,a4a794260c0b4440b466f75d11146db8.ascx.cs" Inherits="SitefinityWebApp.SfCtrlPresentation.OpenAccessDataProvider_a4a794260c0b4440b466f75d11146db8" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Comments" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Fields" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <%@ Register TagPrefix="sf" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" %>

    <telerik:RadListView ID="dynamicContentListView" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
        <LayoutTemplate>
            <ul class="sfitemsList sfitemsListTitleDateTmb">
                <asp:PlaceHolder ID="ItemsContainer" runat="server" />
            </ul>
        </LayoutTemplate>

            <ItemTemplate>
          <li class="sfitem sfClearfix">
                <h2 class="sfitemTitle">
                    <sf:DetailsViewHyperLink ID="DetailsViewHyperLink" TextDataField="Title" runat="server" />
                </h2>
               <sf:AssetsField ID="AssetsField1" runat="server" DataFieldName="Picture" />
               <sf:SitefinityLabel ID="SitefinityLabel1" runat="server" Text='<%# Eval("Designation")%>'  WrapperTagName="div" HideIfNoText="true" CssClass="sfitemShortTxt" />          
              <sf:SitefinityLabel ID="SitefinityLabel2" runat="server" Text='<%# Eval("CompanyName")%>' WrapperTagName="div" HideIfNoText="true" CssClass="sfitemShortTxt" />
              <sf:AssetsField ID="AssetsField2" runat="server" DataFieldName="Documents"/>
          </li>
        </ItemTemplate>
    </telerik:RadListView>
    <sf:Pager id="pager" runat="server"></sf:Pager>

    <sf:ResourceLinks ID="resourcesLinks" runat="server">
        <sf:ResourceFile JavaScriptLibrary="JQuery" />
    </sf:ResourceLinks>

    <script type="text/javascript">
        $(document).ready(function () {
            $(".sfClearfix .sfimageWrp img").click(function () {
                alert("HEY THERE " + $(this).attr("src"));
            });
        });
    </script>
    Regards.

  2. Waseem
    Waseem avatar
    24 posts
    Registered:
    31 Jul 2012
    25 Apr 2012
    Link to this post
    Got it working guys. Following is the code snippet

    <div class="dialogTest"> <br /><br />
    Please enter your email address: <input type="text" name="emailAddress" style="width: 300px;" /><br />
    <br />

    <asp:Button ID="Button1" runat="server" Text="Button" CausesValidation="False" onclick="Button1_Click" />

    <script type="text/javascript">
    $j = jQuery.noConflict();
    $j(document).ready(function () {
        $j(".sfClearfix .sfimageWrp img").click(function () {
            $j(".dialogTest").addClass("open");
            //return $j(this).attr("src");
        });
    });
    </script>

     
2 posts, 0 answered