以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 分页后部分数据显示有误 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=28739) |
-- 作者:atmetmicoo -- 发布时间:2013/2/16 23:07:00 -- 分页后部分数据显示有误 林老师, 我完全参照帮助的分页编码,可是分页后发现几个奇怪的现象,假设数据10条/页,共10页: 1.一般Loadpage为8、9、10几页时,窗口表竟然无任何数据; 2.一般loadpage为5、6、7几页时,加载的数据完全一样 因为项目较大而且启用,发不上来,需要请高手来远程看看,真心感谢啊。 |
-- 作者:lin_hailun -- 发布时间:2013/2/17 9:09:00 -- 应该不会有这样的问题,贴出你相关的代码看看。 |
-- 作者:atmetmicoo -- 发布时间:2013/2/17 9:25:00 -- 林老师,界面如上图所示,代码如下: \'根据权限加载数据按钮 ClientList_BtnAll_Click Dim filter As String Select Case CustomerManageRead ‘全局变量-权限代码 Case "0" filter = "_Identify IS Null" Case "1" filter = "SalesmanID = \'" & TmpUserID & "\' and PubCus = 0" Case "2" filter = "SalesDepartmentID = \'" & TmpDepartmentID & "\' and PubCus = 0" Case "3" filter = "SalesDepartmentID like \'" & TmpDepartmentID & "%\' and PubCus = 0" Case "4" Dim s1 As String = TmpDepartmentID.SubString(0,2) filter = "SalesDepartmentID like \'" & s1 & "%\' and PubCus = 0" Case "5" filter = "PubCus = 0" End Select Dim filter2 As String = "" With DataTables("DA_Customer") .LoadFilter = filter End With e.Form.Controls("TextBox1").value = TmpPagesize Dim BtnFirst As WinForm.Button = e.Form.Controls("BtnOK") BtnFirst.performclick() e.Sender.Enabled = False ClientList_BtnOK_Click Dim TextBox1 As Integer = e.Form.Controls("TextBox1").value If TextBox1 = 0 Or e.Form.Controls("TextBox1").value = "" Then TextBox1 = tmppagesize \'tmppagesize 是分页大小的全局变量,Int型,用户自行设置,一般默认值为100 e.Form.Controls("TextBox1").value = tmppagesize End If tmppagesize = TextBox1 With DataTables("Da_Customer") .LoadTop = tmppagesize .loadpage = 0 .Load() e.Form.Controls("Label1").text = "第" & .LoadPage + 1 & "/" & .TotalPages & "页" & .DataRows.Count If .loadpage > 0 Then e.Form.Controls("BtnFirst").Enabled = True e.Form.Controls("Btnprevious").Enabled = True Else e.Form.Controls("BtnFirst").Enabled = False e.Form.Controls("Btnprevious").Enabled = False End If If .TotalPages - 1 > .loadpage Then e.Form.Controls("BtnNext").Enabled = True e.Form.Controls("BtnLast").Enabled = True Else e.Form.Controls("BtnNext").Enabled = False e.Form.Controls("BtnLast").Enabled = False End If End With \'首页 ClientList_BtnFirst_Click With DataTables("DA_customer") If .LoadPage <> 0 Then .LoadTop = tmppagesize .LoadPage = 0 .Load() End If e.Form.Controls("Label1").text = "第" & DataTables("DA_Customer").LoadPage+1 & "/" & DataTables("DA_Customer").TotalPages & "页" If .loadpage > 0 Then e.Form.Controls("BtnFirst").Enabled = True e.Form.Controls("Btnprevious").Enabled = True Else e.Form.Controls("BtnFirst").Enabled = False e.Form.Controls("Btnprevious").Enabled = False End If If .TotalPages-1 > .loadpage Then e.Form.Controls("BtnNext").Enabled = True e.Form.Controls("BtnLast").Enabled = True Else e.Form.Controls("BtnNext").Enabled = False e.Form.Controls("BtnLast").Enabled = False End If End With ’末页 ClientList_BtnLast_Click With DataTables("DA_customer") If .LoadPage < .TotalPages - 1 Then .LoadPage = .TotalPages - 1 .Load() End If e.Form.Controls("Label1").text = "第" & DataTables("DA_Customer").LoadPage+1 & "/" & DataTables("DA_Customer").TotalPages & "页" If .loadpage > 0 Then e.Form.Controls("BtnFirst").Enabled = True e.Form.Controls("Btnprevious").Enabled = True Else e.Form.Controls("BtnFirst").Enabled = False e.Form.Controls("Btnprevious").Enabled = False End If If .TotalPages-1 > .loadpage Then e.Form.Controls("BtnNext").Enabled = True e.Form.Controls("BtnLast").Enabled = True Else e.Form.Controls("BtnNext").Enabled = False e.Form.Controls("BtnLast").Enabled = False End If End With ‘下一页 ClientList_BtnNext_Click With DataTables("DA_customer") If .LoadPage < .TotalPages - 1 Then .LoadPage = .LoadPage + 1 .Load() End If e.Form.Controls("Label1").text = "第" & DataTables("DA_Customer").LoadPage+1 & "/" & DataTables("DA_Customer").TotalPages & "页" If .loadpage > 0 Then e.Form.Controls("BtnFirst").Enabled = True e.Form.Controls("Btnprevious").Enabled = True Else e.Form.Controls("BtnFirst").Enabled = False e.Form.Controls("Btnprevious").Enabled = False End If If .TotalPages-1 > .loadpage Then e.Form.Controls("BtnNext").Enabled = True e.Form.Controls("BtnLast").Enabled = True Else e.Form.Controls("BtnNext").Enabled = False e.Form.Controls("BtnLast").Enabled = False End If End With ’上一页 ClientList_Btnprevious_Click With DataTables("DA_customer") If .LoadPage > 0 Then .LoadPage = .LoadPage - 1 .Load() End If e.Form.Controls("Label1").text = "第" & .LoadPage+1 & "/" & .TotalPages & "页" If .loadpage > 0 Then e.Form.Controls("BtnFirst").Enabled = True e.Form.Controls("Btnprevious").Enabled = True Else e.Form.Controls("BtnFirst").Enabled = False e.Form.Controls("Btnprevious").Enabled = False End If If .TotalPages-1 > .loadpage Then e.Form.Controls("BtnNext").Enabled = True e.Form.Controls("BtnLast").Enabled = True Else e.Form.Controls("BtnNext").Enabled = False e.Form.Controls("BtnLast").Enabled = False End If End With [此贴子已经被作者于2013-2-17 9:27:08编辑过]
|
-- 作者:lin_hailun -- 发布时间:2013/2/17 10:37:00 -- 远程看看吧,你联系客服QQ |
-- 作者:atmetmicoo -- 发布时间:2013/2/17 11:49:00 -- 谢谢林老师的热心帮助,特在此备注一下以便后人知晓: 此问题是_SortKey重复导致,如果_SortKey不重复,LoadOrder是有效的。
|