我有一个数据集,在数据集中我有两个功能:
GetDataMenuPagin(@PageIndex, @PageSize)
SP_GetCountMenuDataPagin()
我从一个名为“菜单”的表中获取数据,其中包含 1500 条记录。我将页面大小设置为 10,因此总页面必须为 150 页。但是我如何为 pagingtoolbar 设置总计?
这是我的对象数据源和存储,我使用数据集:
<asp:ObjectDataSource ID="MenuDataSource" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetDataMenuPagin" EnablePaging="false"
TypeName="dsHorizonTableAdapters.MenuTableAdapter" OnUpdating="MenuDataSourceUpdating"
DataObjectTypeName="System.Guid" DeleteMethod="Delete" InsertMethod="Insert"
OnSelecting="MenuDataSource_Selecting">
<InsertParameters>
<asp:Parameter DbType="Guid" Name="Id" />
<asp:Parameter DbType="Guid" Name="ParentMenuId" />
<asp:Parameter DbType="Guid" Name="PageId" />
<asp:Parameter Name="Criteria" Type="String" />
<asp:Parameter Name="Display" Type="String" />
<asp:Parameter Name="Description" Type="String" />
<asp:Parameter Name="MenuURL" Type="String" />
<asp:Parameter Name="Sort" Type="String" />
<asp:Parameter Name="IsActive" Type="Boolean" />
<asp:Parameter Name="UpdateDate" Type="DateTime" />
<asp:Parameter Name="UpdateUser" Type="String" />
<asp:Parameter DbType="Guid" Name="MethodId" />
<asp:Parameter Name="Image" Type="String" />
<asp:Parameter DbType="Guid" Name="ProgramId" />
<asp:Parameter DbType="Guid" Name="StatusId" />
</InsertParameters>
<SelectParameters>
<asp:Parameter DefaultValue="0" Name="PageIndex" Type="Int32" />
<asp:Parameter DefaultValue="10" Name="PageSize" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
<ext:Store ID="MenuStore" runat="server" DataSourceID="MenuDataSource" AutoDataBind="false"
AutoLoad="false" onrefreshdata="MenuStore_RefreshData">
<Reader>
<ext:JsonReader IDProperty="Id" AutoDataBind="True">
<Fields>
<ext:RecordField Name="Id" />
<ext:RecordField Name="ParentMenuId" />
<ext:RecordField Name="PageId" />
<ext:RecordField Name="Criteria" />
<ext:RecordField Name="Display" />
<ext:RecordField Name="Description" />
<ext:RecordField Name="MenuURL" />
<ext:RecordField Name="IsActive" DefaultValue="true" />
<ext:RecordField Name="Sort" DefaultValue="0" />
<ext:RecordField Name="UpdateDate" Type="Date" />
<ext:RecordField Name="UpdateUser" />
<ext:RecordField Name="ParentMenuDisplay" />
<ext:RecordField Name="PageDisplay" />
</Fields>
</ext:JsonReader>
</Reader>
<Listeners>
<LoadException Handler="Ext.Msg.Alert('Column - Load failed', e.message || e )" />
<CommitFailed Handler="Ext.Msg.Alert('Column - Commit failed', 'Reason: ' + msg)" />
<SaveException Handler="Ext.Msg.Alert('Column - Save failed', e.message || e)" />
<CommitDone Handler="Ext.Msg.Alert('Column - Commit', 'The data successfully saved');" />
</Listeners>
</ext:Store>