PDA

View Full Version : [CLOSED] Problem when setting up PagingToolbar´s HideRefresh



RCN
Jun 04, 2012, 8:29 PM
Hi Folks, i have a paged GridPanel. When the GridPanel´s AutoLoad property is set to false and PagingToolbar´s HideRefresh is set to true the refresh button hidden just on the first load of store.

In the following example, the refresh button is hidden when the button _btn is clicked.

1 - View


<ext:ResourceManager runat="server" />
<ext:Button ID="_btn" Text="Load Records" runat="server">
<Listeners>
<Click Handler="App.Store1.load();" />
</Listeners>
</ext:Button>
<ext:GridPanel ID="GridPanel1" runat="server" Title="Employees" Frame="true" Height="300">
<Store>
<ext:Store ID="Store1" runat="server" RemoteSort="true" AutoLoad="false" PageSize="5">
<Proxy>
<ext:AjaxProxy Url="/Example/LoadRecords">
<ActionMethods Read="GET" />
<Reader>
<ext:JsonReader Root="data" TotalProperty="total" />
</Reader>
</ext:AjaxProxy>
</Proxy>
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="ID" />
<ext:ModelField Name="Name" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ID="Column1" runat="server" Text="ID" DataIndex="ID" />
<ext:Column ID="Column2" runat="server" Text="Name" DataIndex="Name" />
</Columns>
</ColumnModel>
<BottomBar>
<ext:PagingToolbar ID="PagingToolbar1" runat="server" HideRefresh="true" />
</BottomBar>
</ext:GridPanel>


2 - Controler


public StoreResult LoadRecords(int start, int limit, string sort, string filter)
{

IList<Person> lst = new List<Person>();
for (int index = start; index < limit; index++)
{
lst.Add(new Person
{
ID = index,
Name = "Name" + index
});
}

return new StoreResult
{
Data = lst,
Total = 90
};
}


3 - Entity


public class Person
{
public int ID { get; set; }

public string Name { get; set; }

public Nullable<int> SubEntityID { get; set; }
}



it´s possible to overcome this issue by hiding the refresh button before rendering the PagingToolbar.



<ext:PagingToolbar ID="PagingToolbar1" runat="server" HideRefresh="true">
<Listeners>
<BeforeRender Handler="this.getComponent('refresh').hidden = true;" />
</Listeners>
</ext:PagingToolbar>


but i think that the button should not me visible without any modification.


Thanks in advance

Daniil
Jun 05, 2012, 12:14 PM
Hi,

Thanks for the report. Fixed in SVN, revision #4069.

RCN
Jun 05, 2012, 12:54 PM
Thank you Daniil, please mark it as resolved.