Jul 15, 2009, 2:36 PM
[CLOSED] Mask delay and when component is ready loading?
So here is the situation. Got a store that is bound to a GridPanel. The GridPanel doesn't load until after the page is ready. The Grid gets loaded AFTER everything is loaded via a Ext.onReady function. Everything is working fine, as is. I have a two part question.
First, when I make a store.reload() call in an Ext.onReady function, the corresponding Grid's mask loads for the duration of the Ajax call, then goes away. There is still a delay as it "renders" the data into the grid. Is there a way to delay the mask so that it shows AFTER the data is rendered instead of AFTER the load was successful (and BEFORE the grid is rendered)?
Second, Is there a way better way to load the store via Ajax when the GridPanel component is ready?
This is what I am doing (by the way, the store will hold upwards to about a possible 500 records -- average is about 200):
.aspx:
First, when I make a store.reload() call in an Ext.onReady function, the corresponding Grid's mask loads for the duration of the Ajax call, then goes away. There is still a delay as it "renders" the data into the grid. Is there a way to delay the mask so that it shows AFTER the data is rendered instead of AFTER the load was successful (and BEFORE the grid is rendered)?
Second, Is there a way better way to load the store via Ajax when the GridPanel component is ready?
This is what I am doing (by the way, the store will hold upwards to about a possible 500 records -- average is about 200):
.aspx:
<script language="javascript" type="text/javascript">
Ext.onReady(function() {
var store = Ext.getCmp('gpNotices').getStore();
store.reload({
callback: function() {
// TODO: do some stuff here
}
});
});
</script>
<ext:Store ID="strNotices" runat="server" OnRefreshData="strNotices_RefreshData">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="NoticeId" Type="Int" />
<ext:RecordField Name="NoticeName" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
<ext:GridPanel ID="gpNotices" runat="server" StoreID="strNotices" Title="Notices" Icon="Clock">
<ColumnModel runat="server">
<Columns>
<ext:ImageCommandColumn Width="25">
<Commands>
<ext:ImageCommand CommandName="notice" Icon="ClockGo" />
</Commands>
</ext:ImageCommandColumn>
<ext:Column ColumnID="NoticeName" DataIndex="NoticeName" Header="Notice" />
</Columns>
</ColumnModel>
<Listeners>
<Command Handler="" />
</Listeners>
<LoadMask ShowMask="true" Msg="Loading Notices..." />
</ext:GridPanel>