PB数据窗口实现点击标题栏字段时按相应字段升/降序排序
来源:互联网 发布:应用程序劫持软件 编辑:程序博客网 时间:2024/06/05 19:52
将以下代码复制到想要排序的数据窗口的clicked事件中可实现:
//***********************************按标题头排序********************************//
//*****注:为避免点击标题时所在列变黑色,应将数据窗口的column moving属性去掉******//
//*********************************************************************************//
String ls_name,ls_text
Integer i,li_count,li_num,li_num1
If row <= 0 Then
If This.Describe(dwo.Name + ".Band") = 'header' Then
li_count = Integer(This.Describe("Datawindow.Column.Count"))
for i = 1 to li_count
ls_name = This.Describe("#" + String(i) + ".Name")
ls_text = This.Describe(ls_name + '_t.Text')
li_num = PosW(ls_text,'↑')
li_num1 = PosW(ls_text,'↓')
If li_num > 0 Then
ls_text = ReplaceW(ls_text,li_num,lenW('↑'),'')
ElseIf li_num1 > 0 then
ls_text = ReplaceW(ls_text,li_num1,lenW('↓'),'')
End If
If dwo.Name = (ls_name + '_t') then
If li_num > 0 Then
This.Modify(ls_name + "_t.Text='" + ls_text + "↓'")
This.SetSort(ls_name + " D")
This.Sort()
ElseIf li_num1 > 0 then
This.Modify(ls_name + "_t.Text='" + ls_text + "↑'")
This.SetSort(ls_name + " A")
This.Sort()
Else
This.Modify(ls_name + "_t.Text='" + ls_text + "↑'")
This.SetSort(ls_name + " A")
This.Sort()
End If
Else
If (li_num + li_num1) > 0 Then
This.Modify(ls_name + "_t.Text='" + ls_text + "'")
End If
End If
Next
End If
End If
//***********************************按标题头排序********************************//
//*****注:为避免点击标题时所在列变黑色,应将数据窗口的column moving属性去掉******//
//*********************************************************************************//
String ls_name,ls_text
Integer i,li_count,li_num,li_num1
If row <= 0 Then
If This.Describe(dwo.Name + ".Band") = 'header' Then
li_count = Integer(This.Describe("Datawindow.Column.Count"))
for i = 1 to li_count
ls_name = This.Describe("#" + String(i) + ".Name")
ls_text = This.Describe(ls_name + '_t.Text')
li_num = PosW(ls_text,'↑')
li_num1 = PosW(ls_text,'↓')
If li_num > 0 Then
ls_text = ReplaceW(ls_text,li_num,lenW('↑'),'')
ElseIf li_num1 > 0 then
ls_text = ReplaceW(ls_text,li_num1,lenW('↓'),'')
End If
If dwo.Name = (ls_name + '_t') then
If li_num > 0 Then
This.Modify(ls_name + "_t.Text='" + ls_text + "↓'")
This.SetSort(ls_name + " D")
This.Sort()
ElseIf li_num1 > 0 then
This.Modify(ls_name + "_t.Text='" + ls_text + "↑'")
This.SetSort(ls_name + " A")
This.Sort()
Else
This.Modify(ls_name + "_t.Text='" + ls_text + "↑'")
This.SetSort(ls_name + " A")
This.Sort()
End If
Else
If (li_num + li_num1) > 0 Then
This.Modify(ls_name + "_t.Text='" + ls_text + "'")
End If
End If
Next
End If
End If
- PB数据窗口实现点击标题栏字段时按相应字段升/降序排序
- PB数据窗口对象之字段操作
- PB数据窗口字段锁定不可修改
- PB 数据窗口的字段设置焦点
- PB数据窗口中字段下拉窗口的setfile
- PB数据窗口checkbox字段设置保护的方式
- PB获取数据窗口字段列名和标题名
- PB 数据窗口DW处理图片等大文本字段
- PB数据窗口对象之字段的修改属性
- PB数据窗口modify修改字段下拉属性
- 数据窗口中按字段的显示值排序
- 数据窗口中按字段的显示值排序
- table的点击字段排序的实现
- Mysql中剔除重复字段并按主键降序排序后找出主键值最大的数据
- AJAX 表格字段数据排序,点击表头每列排序
- PB datawindow 数据窗口字段保存显示超过255个字符,要如何设置?
- PB数据窗口对象之字段属性和计算域属性
- AngularJs实现表格点击不同字段排序的功能
- Java获取当前路径
- android音频通信(三)——双向通信(A2B协议)之手机接收
- upnp协议学习(1)
- CentOS下源码安装Apache2.4+PHP5.4+MySQL5.5
- jQuery Mobile 入门教程
- PB数据窗口实现点击标题栏字段时按相应字段升/降序排序
- apache响应报文头部设置
- datagridview 的常用方法
- Spring初感觉
- TCP/IP协议
- Android积累之《Wrong orientation? No orientation specified, and the default is horizontal, yet this la:》
- Linux 性能监测:CPU
- 再次看到那篇博客
- BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the Applic