PDA

View Full Version : [CLOSED] GridPanel DirectEvents



thchuong
Jan 21, 2013, 8:11 AM
Hi,

Before updating svn source, some direct events of gridpanel are working well. However, after updating svn source, they are no longer working and I see that some of them must be moved to directevents of SelectionModel, some of them must be moved to View.

For instance, Select / BeforeSelect / SelectionChange -> SelectionModel; ItemClick -> GridView

Is it correct or a bug?

Thanks and Regards,

Daniil
Jan 21, 2013, 11:11 AM
Hi @thchuong,

It looks to be a bug. Thank you for the report.

If define the same Listeners then DirectEvents appear to be working.

If uncomment the Listeners section in the example below, the DirectEvents fires.

We are investigating.

Example

<%@ 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)
{
Store store = this.GridPanel1.GetStore();
store.DataSource = new object[]
{
new object[] { "test1", "test2", "test3" },
new object[] { "test4", "test5", "test6" },
new object[] { "test7", "test8", "test9" }
};
store.DataBind();
}
}

protected void TestDirectEventHandler(object sender, DirectEventArgs e)
{
X.Msg.Notify("DirectEvent", Request["__EVENTARGUMENT"]).Show();
}
</script>

<!DOCTYPE html>

<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:GridPanel ID="GridPanel1" runat="server">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="test1" />
<ext:ModelField Name="test2" />
<ext:ModelField Name="test3" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="Test1" DataIndex="test1" />
<ext:Column runat="server" Text="Test2" DataIndex="test2" />
<ext:Column runat="server" Text="Test3" DataIndex="test3" />
</Columns>
</ColumnModel>
<DirectEvents>
<ItemClick OnEvent="TestDirectEventHandler" Before="console.log('DirectEvent ItemClick');" />
<BeforeSelect OnEvent="TestDirectEventHandler" Before="console.log('DirectEvent BeforeSelect');" />
<Select OnEvent="TestDirectEventHandler" Before="console.log('DirectEvent Select');" />
<BeforeDeselect OnEvent="TestDirectEventHandler" Before="console.log('DirectEvent BeforeDeselect');" />
<Deselect OnEvent="TestDirectEventHandler" Before="console.log('DirectEvent Deselect');" />
<SelectionChange OnEvent="TestDirectEventHandler" Before="console.log('DirectEvent SelectionChange');" />
</DirectEvents>
<%--<Listeners>
<ItemClick Handler="console.log('Listener ItemClick');" />
<BeforeSelect Handler="console.log('Listener BeforeSelect');" />
<Select Handler="console.log('Listener Select');" />
<BeforeDeselect Handler="console.log('Listener BeforeDeselect');" />
<Deselect Handler="console.log('Listener Deselect');" />
<SelectionChange Handler="console.log('Listener SelectionChange');" />
</Listeners>--%>
</ext:GridPanel>
</form>
</body>
</html>

Daniil
Jan 21, 2013, 2:12 PM
It has been fixed in SVN.

Thank you again for the report.