[CLOSED] Problems with Tooltip autoLoad (AJAX) and height

  1. #1

    [CLOSED] Problems with Tooltip autoLoad (AJAX) and height

    Hi,
    today we tried to load data into a tooltip dynamically on mouse over effect within a grid only on first cell.
    So far so good, but there are three issues:

    - JS Error
    - Height doesn't apply
    - Loads only the first URL, then i shows only the cached AJAX Page.

    We are not sure if we did something wrong, but at least its almost working.
    Here are screens and the code.




    ASPX
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Tests._Default" %>
    <%@ Import Namespace="System.Collections.Generic" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title></title>
        <ext:XScript runat="server">
            <script type="text/javascript">
            var showTip = function () {            
                    var cellIndex = #{GridPanel1}.view.findCellIndex(this.triggerElement);            
                    if(cellIndex != 0)
                    {    
                        #{RowTip}.hide();
                    }            
                    else
                    {
                        var rowIndex = #{GridPanel1}.view.findRowIndex(this.triggerElement);
                        var record = #{Store1}.getAt(rowIndex);
                        #{RowTip}.autoLoad.url = "http://www.google.de/#q=" + record.data.ID;
                    }
                };
            </script>
        </ext:XScript>
    </head>
    <body>
        <form id="form1" runat="server" onsubmit="return false">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:Store runat="server" ID="Store1" RemoteSort="true" OnRefreshData="Store_RefreshData">
            <Reader>
                <ext:JsonReader IDProperty="ID">
                    <Fields>
                        <ext:RecordField Name="ID" />
                        <ext:RecordField Name="NAME" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
            <Proxy>
                <ext:PageProxy>
                </ext:PageProxy>
            </Proxy>
        </ext:Store>
        <ext:GridPanel ID="GridPanel1" runat="server" StoreID="Store1" StripeRows="true"
            Header="false" Height="600px" Border="false" Layout="Fit">
            <LoadMask ShowMask="true" />
            <ColumnModel ID="ColumnModel1" runat="server">
                <Columns>
                    <ext:Column ColumnID="ID" Header="ID" Sortable="true" DataIndex="ID" Align="Right"
                        Width="90px">
                    </ext:Column>
                    <ext:Column ColumnID="NAME" Header="NAME" Sortable="true" DataIndex="NAME" Align="Right"
                        Width="90px">
                    </ext:Column>
                </Columns>
            </ColumnModel>
            <SelectionModel>
                <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
                </ext:RowSelectionModel>
            </SelectionModel>
        </ext:GridPanel>
        <ext:ToolTip ID="RowTip" runat="server" Target="={GridPanel1.getView().mainBody}"
            Delegate=".x-grid3-cell" TrackMouse="true" ShowDelay="1000" Anchor="left" Width="500"
            Height="800">
            <Listeners>
                <Show Fn="showTip" />
            </Listeners>
            <AutoLoad ShowMask="true" NoCache="true">
            </AutoLoad>
        </ext:ToolTip>
        </form>
    </body>
    </html>
    CS
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using Ext.Net;
    
    namespace Tests
    {
        // DATA OBJECT
        public class TheObjects
        {
            public string ID { get; set; }
            public string NAME { get; set; }
        }
    
        // THE PAGE
        public partial class _Default : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                if (!X.IsAjaxRequest)
                {
                    // INIT DATA
                    List<TheObjects> oList = new List<TheObjects>();
                    for (int i = 0; i <= 150; i++)
                    {
                        oList.Add(new TheObjects { ID = "ID" + i, NAME = "Name " + i });
                    }
                    Session["objs"] = oList;
                }
            }
    
            // BIND DATA WITH PROXY
            protected void Store_RefreshData(object sender, StoreRefreshDataEventArgs e)
            {
                Store1.DataSource = Session["objs"];
                Store1.DataBind();
            }
        }
    }
    Thanks.
    Last edited by Daniil; Nov 22, 2010 at 1:36 PM. Reason: [CLOSED]
  2. #2
    Hi,

    JS Error
    JS Error occurs inside Google javascript file. It is not related with Ext.Net (i assume that google page doesn't support to the iframe loading). I can suggest to use Google API to retrieve search items

    Height doesn't apply
    Tooltip doesn't support height (it is autoheight always). I can suggest to add another panel inside Items/Content of the tooltip and set height for that panel

    Loads only the first URL, then i shows only the cached AJAX Page.
    You have to use 'load' method instead autoload.url using
    #{LoadPanel}.load("http://www.google.de/#q=" + data);
    Please note that you have to set iframe mode explicitly if your url doesn't start with 'http' (of course, if iframe mode is required in your case)
    panel.load({url:'Page.aspx', mode:'iframe'});
  3. #3
    Thanks Vladimir, these infos helped. Please mark as solved.

Similar Threads

  1. Replies: 1
    Last Post: Nov 24, 2011, 6:13 PM
  2. [CLOSED] AutoHeight/Fit-Height ... Problems with UseControls
    By macap in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Apr 08, 2011, 9:43 AM
  3. [CLOSED] [1.0] Not able to set Tooltip height and width
    By betamax in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 20, 2010, 4:26 PM
  4. [CLOSED] Ajax tooltip for grid Column
    By pil0t in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 27, 2010, 12:54 PM
  5. Tab Height AutoLoad Height
    By jordnlvr in forum 1.x Help
    Replies: 0
    Last Post: Mar 26, 2010, 7:26 PM

Tags for this Thread

Posting Permissions