PDA

View Full Version : [CLOSED] CommandColumn after store refresh was disappear...



gs_user
May 22, 2012, 7:31 AM
Hi
GridPanel defined CommandColumn, when the store refresh
CommandColumn was disappear
how to fix it??



storemydoc.datasource = list;
storemydoc.databind();

storesign.datasource = list;
stroresign.databind();
// I don't know why that after databind ,GridPanel6 CommandColumn was disappear....




<ext:Window ID="winmydoc" runat="server" Height="600" Icon="Application" Title="myform"
Width="950">
<Items>
<ext:Panel ID="Panel12" runat="server" Header="false" Border="false" Padding="0"
Layout="Fit">
<Items>
<ext:TabPanel ID="Panel18" runat="server" Border="true" Title="" Width="900">
<Items>
<ext:Panel ID="Panel20" runat="server" Title="mydoc" AutoHeight="true">
<TopBar>
<ext:Toolbar ID="Toolbar6" runat="server">
<Items>
<ext:Button ID="bt_myins" runat="server" Text="New(Template)" Icon="ApplicationAdd" OnClientClick="App.WinDocIns.show();">
</ext:Button>
<ext:Button ID="bt_myset" runat="server" Text="New" Icon="ApplicationAdd" OnClientClick="App.WinSetDoc.show();">
</ext:Button>
<ext:Button ID="bt_myupd" runat="server" Text="Edit" Icon="ApplicationEdit">
<DirectEvents>
<Click OnEvent="SubmitMyDocSelection">
<ExtraParams>
<ext:Parameter Name="Values" Value="Ext.encode(#{GridPanel5}.getRowsValues({selectedOn ly : true}))"
Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>

<ext:Button ID="bt_myact" runat="server" Text="Act" Icon="ApplicationDelete">
<DirectEvents>
<Click OnEvent="ACTDocSelection">
<ExtraParams>
<ext:Parameter Name="Values" Value="Ext.encode(#{GridPanel5}.getRowsValues({selectedOn ly:true}))"
Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
<ext:Button ID="bt_myconf" runat="server" Text="Confirm" Icon="ApplicationLightning">
<DirectEvents>
<Click OnEvent="CONFDocSelection">
<ExtraParams>
<ext:Parameter Name="Values" Value="Ext.encode(#{GridPanel5}.getRowsValues({selectedOn ly:true}))"
Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
<ext:ToolbarFill ID="ToolbarFill5" runat="server" />
</Items>
</ext:Toolbar>
</TopBar>
<Items>
<ext:GridPanel ID="GridPanel5" runat="server" Title="" Height="480">
<Store>
<ext:Store ID="storemydoc" runat="server" SerializationMode="Complex">
<Model>
<ext:Model ID="Model6" runat="server" IDProperty="DC101">
<Fields>
<ext:ModelField runat="server" Name="DC101" />
<ext:ModelField runat="server" Name="DC103" />
<ext:ModelField runat="server" Name="DC104" />
<ext:ModelField runat="server" Name="DC111" />
<ext:ModelField runat="server" Name="DC115" />
<ext:ModelField runat="server" Name="DC117" />
<ext:ModelField runat="server" Name="DC109" />
<ext:ModelField runat="server" Name="DC110" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel3" runat="server">
<Columns>
<ext:Column ID="Column19" runat="server" Header="no" DataIndex="DC101" />
<ext:Column ID="Column20" runat="server" Header="subject" DataIndex="DC103" />
<ext:Column ID="Column21" runat="server" Header="desc" DataIndex="DC104" />
<ext:Column ID="Column22" runat="server" Header="applydate" DataIndex="DC111" />
<ext:Column ID="Column23" runat="server" Header="level" DataIndex="DC115" Width="60" />
<ext:Column ID="Column24" runat="server" Header="date" DataIndex="DC117" />
<ext:Column ID="Column25" runat="server" Header="act" DataIndex="DC109" Width="60"/>
<ext:Column ID="Column26" runat="server" Header="status" DataIndex="DC110" Width="60"/>
<ext:CommandColumn ID="CommandColumn2" runat="server" Width="70">
<Commands>
<ext:GridCommand Icon="PageEdit" CommandName="DOCSignFlow" Text="flow" />
</Commands>
<Listeners>
<Command Handler="App.direct.CommandSet(command,record.data.DC101);" />
</Listeners>
</ext:CommandColumn>
<ext:CommandColumn ID="CommandColumn13" runat="server" Width="70">
<Commands>
<ext:GridCommand Icon="PageEdit" CommandName="MyUploadForm" Text="form" />
</Commands>
<Listeners>
<Command Handler="App.direct.CommandSet(command,record.data.DC101);" />
</Listeners>
</ext:CommandColumn>
<ext:CommandColumn ID="CommandColumn7" runat="server" Width="70">
<Commands>
<ext:GridCommand Icon="PageEdit" CommandName="UploadDoc" Text="check attachfile" />
</Commands>
<Listeners>
<Command Handler="App.direct.CommandSet(command,record.data.DC101);" />
</Listeners>
</ext:CommandColumn>
</Columns>
</ColumnModel>
<BottomBar>
<ext:PagingToolbar ID="PagingToolbar3" runat="server" PageSize="16" HideRefresh="True">
</ext:PagingToolbar>
</BottomBar>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel3" runat="server" Mode="Single" />
</SelectionModel>
</ext:GridPanel>
</Items>
</ext:Panel>
<ext:Panel ID="Panel21" runat="server" Title="Document" AutoHeight="true">
<Items>
<ext:GridPanel ID="GridPanel6" runat="server" Height="480" Title="">
<Store>
<ext:Store ID="StoreSign" runat="server" SerializationMode="Complex">
<Model>
<ext:Model ID="Model7" runat="server" IDProperty="DC101">
<Fields>
<ext:ModelField runat="server" Name="DC101" />
<ext:ModelField runat="server" Name="DC103" />
<ext:ModelField runat="server" Name="DC104" />
<ext:ModelField runat="server" Name="DC111" />
<ext:ModelField runat="server" Name="DC115" />
<ext:ModelField runat="server" Name="DC117" />
<ext:ModelField runat="server" Name="DC109" />
<ext:ModelField runat="server" Name="DC110" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel4" runat="server">
<Columns>
<ext:Column ID="Column27" runat="server" Header="no" DataIndex="DC101" />
<ext:Column ID="Column28" runat="server" Header="subject" DataIndex="DC103" />
<ext:Column ID="Column29" runat="server" Header="desc" DataIndex="DC104" />
<ext:Column ID="Column30" runat="server" Header="applydate" DataIndex="DC111" />
<ext:Column ID="Column31" runat="server" Header="lavel" DataIndex="DC115" Width="60"/>
<ext:Column ID="Column32" runat="server" Header="date" DataIndex="DC117" />
<ext:Column ID="Column33" runat="server" Header="act" DataIndex="DC109" Width="60"/>
<ext:Column ID="Column34" runat="server" Header="status" DataIndex="DC110" Width="60"/>
<ext:CommandColumn ID="CommandColumn3" runat="server" Width="70">
<Commands>
<ext:GridCommand Icon="PageEdit" CommandName="DOCSignFlow" Text="flow" />
</Commands>
<Listeners>
<Command Handler="App.direct.CommandSet(command,record.data.DC101);" />
</Listeners>
</ext:CommandColumn>
<ext:CommandColumn ID="CommandColumn15" runat="server" Width="70">
<Commands>
<ext:GridCommand Icon="PageEdit" CommandName="MyUploadForm" Text="form" />
</Commands>
<Listeners>
<Command Handler="App.direct.CommandSet(command,record.data.DC101);" />
</Listeners>
</ext:CommandColumn>
<ext:CommandColumn ID="CommandColumn8" runat="server" Width="70">
<Commands>
<ext:GridCommand Icon="PageEdit" CommandName="UploadDoc" Text="check attachfile" />
</Commands>
<Listeners>
<Command Handler="App.direct.CommandSet(command,record.data.DC101);" />
</Listeners>
</ext:CommandColumn>

</Columns>
</ColumnModel>
<BottomBar>
<ext:PagingToolbar ID="PagingToolbar4" runat="server" PageSize="16" HideRefresh="True">
</ext:PagingToolbar>
</BottomBar>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel4" runat="server" Mode="Single" />
</SelectionModel>
</ext:GridPanel>
</Items>
</ext:Panel>

</Items>
</ext:Panel>
</Items>
</ext:TabPanel>
</Items>
</ext:Panel>
</Items>
</ext:Window>

Daniil
May 22, 2012, 9:39 AM
Hi,

I am unable to reproduce the problem using the example below.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
private void DataBind()
{
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 Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.DataBind();
}
}

protected void Refresh(object sender, DirectEventArgs e)
{
this.DataBind();
}
</script>

<!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 runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<ext:ResourceManager runat="server" />

<ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
<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" />
<ext:CommandColumn runat="server">
<Commands>
<ext:GridCommand CommandName="test" Text="Test" Icon="Accept" />
</Commands>
</ext:CommandColumn>
</Columns>
</ColumnModel>
</ext:GridPanel>

<ext:Button runat="server" Text="Refresh" OnDirectClick="Refresh" />
</body>
</html>

Please provide a full test case.

Is the issue reproducible with the latest sources from SVN?

gs_user
May 22, 2012, 11:46 AM
When click Refresh button ,second tabpanel commandcolumn was disappear
my version was the fileupload component can't work
I rebuild the sourcecode, the version was not the latest?



<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
private void DataBind()
{
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 Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.DataBind();
this.DataBind1();
}
}

private void DataBind1()
{
Store store = this.GridPanel2.GetStore();
store.DataSource = new object[]
{
new object[] { "test1", "test2", "test3" },
new object[] { "test4", "test5", "test6" },
new object[] { "test7", "test8", "test9" },
};
store.DataBind();
}

protected void Refresh(object sender, DirectEventArgs e)
{
this.DataBind();
this.DataBind1();
}
</script>

<!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>Ext.NET v2 Example</title>
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Panel ID="Panel1" runat="server" Height="300" Title="Title">
<Items>
<ext:TabPanel ID="TabPanel1" runat="server" Height="300">
<Items>
<ext:Panel ID="Panel2" runat="server" Title="Tab 1">
<Items>
<ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="test1" />
<ext:ModelField Name="test2" />
<ext:ModelField Name="test3" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ID="Column1" runat="server" Text="Test1" DataIndex="test1" />
<ext:Column ID="Column2" runat="server" Text="Test2" DataIndex="test2" />
<ext:Column ID="Column3" runat="server" Text="Test3" DataIndex="test3" />
<ext:CommandColumn ID="CommandColumn1" runat="server">
<Commands>
<ext:GridCommand CommandName="test" Text="Test" Icon="Accept" />
</Commands>
</ext:CommandColumn>
</Columns>
</ColumnModel>
</ext:GridPanel>
</Items>
</ext:Panel>
<ext:Panel ID="Panel3" runat="server" Title="Tab 2">
<Items>
<ext:GridPanel ID="GridPanel2" runat="server" AutoHeight="true">
<Store>
<ext:Store ID="Store2" runat="server">
<Model>
<ext:Model ID="Model2" runat="server">
<Fields>
<ext:ModelField Name="test1" />
<ext:ModelField Name="test2" />
<ext:ModelField Name="test3" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel2" runat="server">
<Columns>
<ext:Column ID="Column4" runat="server" Text="Test1" DataIndex="test1" />
<ext:Column ID="Column5" runat="server" Text="Test2" DataIndex="test2" />
<ext:Column ID="Column6" runat="server" Text="Test3" DataIndex="test3" />
<ext:CommandColumn ID="CommandColumn2" runat="server">
<Commands>
<ext:GridCommand CommandName="test" Text="Test" Icon="Accept" />
</Commands>
</ext:CommandColumn>
</Columns>
</ColumnModel>
</ext:GridPanel>

</Items>
</ext:Panel>
<ext:Panel ID="Panel4" runat="server" Title="Tab 3">
<Items>
</Items>
</ext:Panel>
</Items>
</ext:TabPanel>
</Items>
</ext:Panel>

<ext:Button ID="Button1" runat="server" Text="Refresh" OnDirectClick="Refresh" />
</body>
</html>

Daniil
May 22, 2012, 3:31 PM
When click Refresh button ,second tabpanel commandcolumn was disappear

Please clarify is the issue not reproducible anymore after update from SVN?


my version was the fileupload component can't work

Please provide more details.


I rebuild the sourcecode, the version was not the latest?

Currently, we have update SVN sources almost each day.

gs_user
May 23, 2012, 6:59 AM
I already update SVN,this issue still happen.
You can use the sameple to testing.



<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
private void DataBind()
{
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 Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.DataBind();
this.DataBind1();
}
}

private void DataBind1()
{
Store store = this.GridPanel2.GetStore();
store.DataSource = new object[]
{
new object[] { "test1", "test2", "test3" },
new object[] { "test4", "test5", "test6" },
new object[] { "test7", "test8", "test9" },
};
store.DataBind();
}

protected void Refresh(object sender, DirectEventArgs e)
{
this.DataBind();
this.DataBind1();
}
</script>

<!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>Ext.NET v2 Example</title>
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Panel ID="Panel1" runat="server" Height="300" Title="Title">
<Items>
<ext:TabPanel ID="TabPanel1" runat="server" Height="300">
<Items>
<ext:Panel ID="Panel2" runat="server" Title="Tab 1">
<Items>
<ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="test1" />
<ext:ModelField Name="test2" />
<ext:ModelField Name="test3" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ID="Column1" runat="server" Text="Test1" DataIndex="test1" />
<ext:Column ID="Column2" runat="server" Text="Test2" DataIndex="test2" />
<ext:Column ID="Column3" runat="server" Text="Test3" DataIndex="test3" />
<ext:CommandColumn ID="CommandColumn1" runat="server">
<Commands>
<ext:GridCommand CommandName="test" Text="Test" Icon="Accept" />
</Commands>
</ext:CommandColumn>
</Columns>
</ColumnModel>
</ext:GridPanel>
</Items>
</ext:Panel>
<ext:Panel ID="Panel3" runat="server" Title="Tab 2">
<Items>
<ext:GridPanel ID="GridPanel2" runat="server" AutoHeight="true">
<Store>
<ext:Store ID="Store2" runat="server">
<Model>
<ext:Model ID="Model2" runat="server">
<Fields>
<ext:ModelField Name="test1" />
<ext:ModelField Name="test2" />
<ext:ModelField Name="test3" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel2" runat="server">
<Columns>
<ext:Column ID="Column4" runat="server" Text="Test1" DataIndex="test1" />
<ext:Column ID="Column5" runat="server" Text="Test2" DataIndex="test2" />
<ext:Column ID="Column6" runat="server" Text="Test3" DataIndex="test3" />
<ext:CommandColumn ID="CommandColumn2" runat="server">
<Commands>
<ext:GridCommand CommandName="test" Text="Test" Icon="Accept" />
</Commands>
</ext:CommandColumn>
</Columns>
</ColumnModel>
</ext:GridPanel>

</Items>
</ext:Panel>
<ext:Panel ID="Panel4" runat="server" Title="Tab 3">
<Items>
</Items>
</ext:Panel>
</Items>
</ext:TabPanel>
</Items>
</ext:Panel>

<ext:Button ID="Button1" runat="server" Text="Refresh" OnDirectClick="Refresh" />
</body>
</html>




Please clarify is the issue not reproducible anymore after update from SVN?



Please provide more details.



Currently, we have update SVN sources almost each day.

Daniil
May 23, 2012, 11:01 AM
Please set up

HideMode="Offsets"
for the tabs (i.e. Panel2 and Panel3).

gs_user
May 24, 2012, 8:37 AM
It's can work, thanks for your help


Please set up

HideMode="Offsets"
for the tabs (i.e. Panel2 and Panel3).