Jun 20, 2011, 8:18 PM
When I try to Pass an ID in the " Store.Load({params: ( " my PAGING starts up with "NaN" as the first page...
Hi,
I'm using Paging and if works fine, the ONLY issue I have is when I try to pass a value in the Parameter in the Store as stated below, the Grid loads up fine, but the Window in the Paging in the bottom of the Grid shows "NaN" for the FIRST Page...
I track down the reason to this:
ProductsStore.load({ params: { productGroupID: 999} });
If I comment these lines out and replace it with ProductsStore.load(); and HARD CODE the value (eg. 999), PAGING WORKS FINE...
.aspx
.ashx.vb
I'm using Paging and if works fine, the ONLY issue I have is when I try to pass a value in the Parameter in the Store as stated below, the Grid loads up fine, but the Window in the Paging in the bottom of the Grid shows "NaN" for the FIRST Page...
I track down the reason to this:
ProductsStore.load({ params: { productGroupID: 999} });
If I comment these lines out and replace it with ProductsStore.load(); and HARD CODE the value (eg. 999), PAGING WORKS FINE...
.aspx
<ext:GridPanel ID="gpProductGroup" runat="server" Height="450" StoreID="ProductGroupStore"
TrackMouseOver="true" Title="Manage Product Group Names" StripeRows="true" AutoScroll="true"
DisableSelection="true">
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column DataIndex="Description" Header="Product Group Name" Sortable="true" />
<ext:Column Header="Status" DataIndex="Status" Sortable="true">
<Renderer Fn="formatStatus" />
</ext:Column>
<ext:CommandColumn Width="50">
<Commands>
<ext:GridCommand CommandName="Edit" Text="Edit Product Group" Icon="ApplicationEdit" />
</Commands>
</ext:CommandColumn>
<ext:CommandColumn Width="50">
<Commands>
<ext:GridCommand CommandName="Delete" Icon="Delete" Text="Delete this group" />
</Commands>
</ext:CommandColumn>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" />
</SelectionModel>
<View>
<ext:GridView ID="gvProductGroup" runat="server" ForceFit="true">
</ext:GridView>
</View>
<Listeners>
<Command Fn="commandHandler" />
</Listeners>
</ext:GridPanel>
.Javascript
var commandHandler = function(cmd, record) {
record = record.data;
if (cmd == "Edit") {
AddProductsToGroupWindow.setTitle('Modify Product Group');
var productGroupIdValue = record.ProductGroupID;
if (productGroupIdValue != "")
{
// Load ProductsStore with Product Groups...
gpProductGroupList.getSelectionModel().clearSelections();
ProductsStore.load({ params: { productGroupID: 999} });
}
PopulateModalData(record.ProductGroupID, record.Description, record.Status);
AddProductsToGroupWindow.show();
}
else if (cmd == "Delete") {
Ext.Msg.confirm("Confirm", "Are you sure you wish to delete this product group?", function(result) {
if (result == "yes") {
Coolite.AjaxMethods.ProductGroup.DeleteProductGroup(record.ProductGroupID, {
success: function(result) {
ProductGroupStore.load();
},
failure: function(result) {
PageManagement.HandleError();
},
eventMask: {
showMask: true,
msg: "Updating Grid..."
}
});
}
});
}
}
.ashx.vb
Public Overrides Sub ProcessRequest(ByVal context As System.Web.HttpContext)
Dim productGroupId As Integer = context.Request(PRODUCT_GROUP_ID).AsInt(0)
End Sub
This value 999 come through but once again, the first Page in the Grid for Paging says, "NaN"
Last edited by RonaldR; Jun 21, 2011 at 4:16 PM.
Reason: I updated the Code as per sample below, same issue...