Hello Emidio!
I probably still don't understand your needs but I don't think relayEvent is what you need. The gridPanel fires the load (or the store bound to the grid panel... or the view bound to the gridPanel). While a store may not have a reference to the gridPanel, the grid panel's view will, and you should be able to bind the
refresh event, for example.
You can review
relayEvents() documentation, origin is the component which the current component will be relaying. A little confuse but I believe you'll understand once you read the documentation.
I couldn't piece together your code snippets to make anything out of what you provided, unfortunately. Instead, check this example:
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.Store1.DataSource = this.Data;
}
}
private object[] Data
{
get
{
return new object[]
{
new object[] { "3m Co", 71.72, 0.02, 0.03, "9/1 12:00am" },
new object[] { "Alcoa Inc", 29.01, 0.42, 1.47, "9/1 12:00am" },
new object[] { "Altria Group Inc", 83.81, 0.28, 0.34, "9/1 12:00am" },
new object[] { "American Express Company", 52.55, 0.01, 0.02, "9/1 12:00am" },
new object[] { "American International Group, Inc.", 64.13, 0.31, 0.49, "9/1 12:00am" },
new object[] { "AT&T Inc.", 31.61, -0.48, -1.54, "9/1 12:00am" },
new object[] { "Boeing Co.", 75.43, 0.53, 0.71, "9/1 12:00am" },
new object[] { "Caterpillar Inc.", 67.27, 0.92, 1.39, "9/1 12:00am" },
new object[] { "Citigroup, Inc.", 49.37, 0.02, 0.04, "9/1 12:00am" }
};
}
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Grid panel load/reload event: reference to own grid</title>
</head>
<body>
<ext:ResourceManager runat="server" />
<h1>Simple Array Grid</h1>
<ext:GridPanel
runat="server"
Title="Array Grid"
Width="700"
Height="350">
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model 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>
<Columns>
<ext:Column runat="server" Text="Company" DataIndex="company" Flex="1" />
<ext:Column runat="server" Text="Price" DataIndex="price" />
<ext:Column runat="server" Text="Change" DataIndex="change" />
<ext:Column runat="server" Text="Change" DataIndex="pctChange" />
<ext:DateColumn runat="server" Text="Last Updated" DataIndex="lastChange" Width="120" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel runat="server" />
</SelectionModel>
<ViewConfig runat="server">
<Listeners>
<Refresh Handler="Ext.Msg.alert('Panel ID', 'Panel ID is [' + this.ownerGrid.id + ']');" />
</Listeners>
</ViewConfig>
<BottomBar>
<ext:Toolbar runat="server">
<Items>
<ext:Button runat="server" Text="Reload" Icon="Reload" Handler="this.up('grid').getView().refresh();" />
</Items>
</ext:Toolbar>
</BottomBar>
</ext:GridPanel>
</body>
</html>
Hope this helps!