GridFilters + HttpProxyStore + Hanlder ||How to pass the param
<ext:HttpProxy Method="POST" Url="/Handler/GetStore.ashx" />
How to pass the filer text to the handler?
RE: GridFilters + HttpProxyStore + Hanlder ||How to pass the param
Hi,
Use BaseParams or AutoLoadParams of Store*
When I used BaseParams while using Paging, the first Page on the Grid show 'NaN'
When using Paging, Grid on first page loads up and shows 'NaN'
.vb (Sample on Page Load)
Code:
' Load Product
ProductsStore.Proxy.Add(New HttpProxy() With {.Method = HttpMethod.GET, _
.Url = Core.Web.ProcessController.ProductGroup.GetAllProductsForProductGroupHandlerUrl() _
})
' Use for Paging...
ProductsStore.AutoLoadParams.Add(New Parameter() With {.Name = Core.Constants.START_PARAM, .Mode = ParameterMode.Raw, .Value = "={" + Core.Constants.START_PARAM_NUMBER + "}"})
ProductsStore.AutoLoadParams.Add(New Parameter() With {.Name = Core.Constants.LIMIT_PARAM, .Mode = ParameterMode.Raw, .Value = "={" + Core.Constants.LIMIT_PARAM_NUMBER + "}"})
ProductsStore.BaseParams.Add(New Parameter() With {.Name = Core.Constants.PRODUCT_GROUP_ID, .Mode = ParameterMode.Raw, .Value = "={" + CStr(999) + "}"})
.aspx (Grid)
Code:
<ext:GridPanel ID="gpProductGroupList" runat="server" Height="300px" AutoWidth="true"
StoreID="ProductsStore" TrackMouseOver="true" Title="Manage Product Names" StripeRows="true"
AutoScroll="true" AutoDataBind="true" AutoExpandColumn="ProductName">
<ColumnModel ID="ColumnModel2" runat="server">
<Columns>
<ext:Column ColumnID="ProductId" DataIndex="ProductId" Header="Product Code" Sortable="true" />
<ext:Column ColumnID="UPCCode" DataIndex="UPCCode" Header="UPC Code" Sortable="true" />
<ext:Column ColumnID="ProductName" DataIndex="ProductName" Header="Product Name"
Sortable="true" />
</Columns>
</ColumnModel>
<View>
<ext:GridView ID="gvProduts" runat="server" ForceFit="true" EnableRowBody="true" />
</View>
<SelectionModel>
<ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" HideCheckAll="true"
SingleSelect="false" />
</SelectionModel>
<BottomBar>
<ext:PagingToolbar ID="PagingToolBar1" runat="server" PageSize="20" DisplayInfo="true"
DisplayMsg="Displaying items {0} - {1} of {2}" EmptyMsg="No items to display" />
</BottomBar>
<LoadMask ShowMask="true" Msg="Loading..." />
</ext:GridPanel>
.aspx (Store)
Code:
<ext:Store ID="ProductsStore" runat="server" RemoteSort="true" AutoLoad="false">
<Reader>
<ext:JsonReader Root="Data" ReaderID="ProductId" TotalProperty="TotalRecords">
<Fields>
<ext:RecordField Name="ProductId" Type="String" />
<ext:RecordField Name="MarketID" Type="String" />
<ext:RecordField Name="ProductName" Type="String" />
<ext:RecordField Name="UPCCode" Type="Int" />
<ext:RecordField Name="FreshDryIndicator" Type="String" />
<ext:RecordField Name="EquivalentUnits" Type="Int" />
<ext:RecordField Name="JobTag" Type="Int" />
<ext:RecordField Name="ActiveFlag" Type="Int" />
<ext:RecordField Name="LastModifyUserID" Type="Int" />
<ext:RecordField Name="LastModifyDateTime" Type="Date" />
<ext:RecordField Name="InsertionDateTime" Type="Date" />
<ext:RecordField Name="InGroup" Type="Boolean" />
</Fields>
</ext:JsonReader>
</Reader>
<Listeners>
<Load Fn="selectRows" />
</Listeners>
</ext:Store>
Or within the Javascript like below...
Code:
ProductsStore.load({ params: { productGroupID: record.ProductGroupID} });
[SOLVED]: my PAGING starts up with "NaN" as the first page...
I solved my issue which I found on your Forum, "[CLOSED] Remote paging GridPanel"
I used this below:
Code:
ProductsStore.BaseParams.Add(New Parameter() With {.Name = Core.Constants.START_PARAM, .Value = "={" + Core.Constants.START_PARAM_NUMBER + "}"})
ProductsStore.BaseParams.Add(New Parameter() With {.Name = Core.Constants.LIMIT_PARAM, .Value = "={" + Core.Constants.LIMIT_PARAM_NUMBER + "}"})