May 13, 2011, 9:23 AM
[CLOSED] Slow loading of Grid Command with Prepare functions
Using Coolite Version 0.8.2.30060
We have a grid like below, this displays all the asp.net users and has 2 command columns. We have 350+ users in the system and the command columns PrepareToolbar functions cause it to load very slow (10+seconds) If we remove the Prepare functions it loads in less than a second. Is there anything you can recomend to speed up the prepare functions at all?
Cheers
Rob
We have a grid like below, this displays all the asp.net users and has 2 command columns. We have 350+ users in the system and the command columns PrepareToolbar functions cause it to load very slow (10+seconds) If we remove the Prepare functions it loads in less than a second. Is there anything you can recomend to speed up the prepare functions at all?
Cheers
Rob
<ext:Panel ID="WestPanel" runat="server" Width="200" Border="true">
<Body>
<ext:FitLayout runat="server">
<ext:GridPanel runat="server" ID="UserGrid" StoreID="UserStore" AutoExpandColumn="User" >
<AjaxEvents>
<RowClick OnEvent="UserGrid_Click">
<EventMask ShowMask="true" />
<ExtraParams>
<ext:Parameter Name="Values" Value="Ext.encode(#{UserGrid}.getRowsValues())" Mode="Raw" />
<ext:Parameter Name="index" Value="rowIndex" Mode="Raw" />
</ExtraParams>
</RowClick>
</AjaxEvents>
<ColumnModel ID="ColumnModel1" runat="server" >
<Columns>
<ext:CommandColumn Width="30">
<Commands>
<ext:GridCommand Icon="Delete" CommandName="ReEnable" />
<ext:GridCommand Icon="Accept" CommandName="Disable" />
</Commands>
<PrepareToolbar Fn="prepare" />
</ext:CommandColumn>
<ext:CommandColumn Width="30">
<Commands>
<ext:GridCommand Icon="LockKey" CommandName="Unlock" />
</Commands>
<PrepareToolbar Fn="preparelock" />
</ext:CommandColumn>
<ext:Column ColumnID="User" Header="Users" DataIndex="UserName" Sortable="true" MenuDisabled="true" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
</SelectionModel>
<AjaxEvents>
<Command OnEvent="Clicked" >
<EventMask ShowMask="true" />
<ExtraParams>
<ext:Parameter Name="Values" Value="Ext.encode(#{UserGrid}.getRowsValues())" Mode="Raw" />
<ext:Parameter Name="CMD" Mode="Raw" Value="command" />
</ExtraParams>
</Command>
</AjaxEvents>
<ToolTips>
<ext:ToolTip ID="ToolTip2" runat="server" Title="Tip" Html="Select a User to see what Roles they are a member of" />
</ToolTips>
<View>
<ext:GridView ID="GridView1" runat="server" />
</View>
</ext:GridPanel>
</ext:FitLayout>
</Body>
</ext:Panel>
var preparelock = function(grid, toolbar, rowIndex, record) {
var lockButton = toolbar.items.get(0);
if (record.data.IsLockedOut == true) {
lockButton.setVisible(true);
lockButton.setTooltip('Click to Unlock User');
}
else {
lockButton.setVisible(false);
}
}
var prepare = function(grid, toolbar, rowIndex, record) {
var enableButton = toolbar.items.get(0);
var disableButton = toolbar.items.get(1);
if (record.data.IsApproved == false) {
disableButton.setVisible(false);
enableButton.setTooltip('Click to Re-Enable User');
}
if (record.data.IsApproved == true) {
enableButton.setVisible(false);
disableButton.setTooltip('Click to Disable User');
}
var Accs = ('<%= ConfigurationManager.AppSettings("AdminAccounts") %>');
var AdminAccs = Accs.split("|");
if (AdminAccs.indexOf(record.data.UserName) > -1) {
enableButton.setVisible(false);
disableButton.setVisible(false);
}
}
Last edited by Daniil; May 13, 2011 at 2:54 PM.
Reason: [CLOSED]