PDA

View Full Version : [CLOSED] Coexistence problems between TooTip and Column-Locked



opendat2000
May 09, 2014, 10:08 PM
Hi Team !!

Currently im using the control ToolTip in a GridPanel, but i'm having problems with this control when a column
from gridpanel have a "true" value for the locked property.




<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.Store1.DataSource = new object[]
{
new object[] { "3m Co", 71, 0.02, 0.03, "9/1 12:00am" },
new object[] { "Alcoa Inc", 29, 0.42, 1.47, "9/1 12:00am" },
new object[] { "Altria Group Inc", 83, 0.28, 0.34, "9/1 12:00am" },
new object[] { "American Express Company", 52, 0.01, 0.02, "9/1 12:00am" },
new object[] { "American International Group, Inc.", 64, 0.31, 0.49, "9/1 12:00am" },
new object[] { "AT&T Inc.", 31, -0.48, -1.54, "9/1 12:00am" },
new object[] { "Boeing Co.", 75, 0.53, 0.71, "9/1 12:00am" },
new object[] { "Caterpillar Inc.", 67, 0.92, 1.39, "9/1 12:00am" },
new object[] { "Citigroup, Inc.", 49, 0.02, 0.04, "9/1 12:00am" },
new object[] { "E.I. du Pont de Nemours and Company", 40, 0.51, 1.28, "9/1 12:00am" },
new object[] { "Exxon Mobil Corp", 68.1, -0.43, -0.64, "9/1 12:00am" },
new object[] { "General Electric Company", 34, -0.08, -0.23, "9/1 12:00am" },
new object[] { "General Motors Corporation", 30, 1.09, 3.74, "9/1 12:00am" },
new object[] { "Hewlett-Packard Co.", 36, -0.03, -0.08, "9/1 12:00am" },
new object[] { "Honeywell Intl Inc", 38, 0.05, 0.13, "9/1 12:00am" },
new object[] { "Intel Corporation", 19, 0.31, 1.58, "9/1 12:00am" },
new object[] { "International Business Machines", 81, 0.44, 0.54, "9/1 12:00am" },
};

this.Store1.DataBind();
}
}
</script>

<!DOCTYPE html>

<html>
<head id="Head1" runat="server">
<title>GridPanel Row with ToolTip - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" />

<script>
var OnShowPage = function (toolTip, grid)
{
var view = grid.getView();
var record = view.getRecord(toolTip.triggerElement);

if (record.data.price > 50)
{
toolTip.update('Hello World !!');
return true;
}
else
{
toolTip.update('');
return false;
}
};
</script>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />

<h1>GridPanel Row with ToolTip</h1>

<ext:GridPanel
ID="GridPanel1"
runat="server"
Title="Array Grid"
Width="600"
Height="350">
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="company" />
<ext:ModelField Name="price" Type="Float" />
<ext:ModelField Name="change" Type="Float" />
<ext:ModelField Name="pctChange" Type="Float" />
<ext:ModelField Name="lastChange" Type="Date" DateFormat="M/d hh:mmtt" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ID="Column1" runat="server" Text="Company" DataIndex="company" Locked="true"/>
<%--<ext:Column ID="Column5" runat="server" Text="Company" DataIndex="company" />--%>
<ext:Column ID="Column2" runat="server" Text="Price" DataIndex="price">
<Renderer Format="UsMoney" />
</ext:Column>
<ext:Column ID="Column3" runat="server" Text="Change" DataIndex="change">
</ext:Column>
<ext:Column ID="Column4" runat="server" Text="Change" DataIndex="pctChange">
</ext:Column>
<ext:DateColumn ID="DateColumn1" runat="server" Text="Last Updated" DataIndex="lastChange" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" Mode="Single">
</ext:RowSelectionModel>
</SelectionModel>
<View>
<ext:GridView ID="GridView1" runat="server" StripeRows="true" TrackOver="true" />
</View>
</ext:GridPanel>

<ext:ToolTip ID="ToolTip1"
runat="server"
Target="={#{GridPanel1}.getView().el}"
Delegate="={#{GridPanel1}.getView().itemSelector}"
TrackMouse="true">
<Listeners>
<BeforeShow Handler="return OnShowPage(this, #{GridPanel1});" />
</Listeners>
</ext:ToolTip>
</form>
</body>
</html>



Any Help is appreciated.
Regards.

Daniil
May 12, 2014, 7:14 AM
Hi @opendat2000,

It is because of

Delegate="={#{GridPanel1}.view.itemSelector}"

The statement returns undefined, because there are two views - normal and locked.

You can use the following:

Delegate="={#{GridPanel1}.normalGrid.view.itemSelector}"

opendat2000
May 12, 2014, 12:51 PM
Daniil thank you very much for your support

Topic closed....

Saludos
Mauricio.