当前位置: 代码迷 >> PB >> 数据窗口列标题升降排序失败?该如何解决
  详细解决方案

数据窗口列标题升降排序失败?该如何解决

热度:47   发布时间:2016-04-29 10:08:27.0
数据窗口列标题升降排序失败?
数据窗口dw_retrieve的click事件继承user object

SetRow(row)

This.SelectRow_Single(row)
This.SelectRows_Muti(row)

IF dwo.name = 'datawindow' THEN
This.SelectRow(0, FALSE)
END IF

sort(dwo)

且 列标题 都以_t结尾
为什么不能实现点击标题名称排序?

------解决方案--------------------
是不是没有调用父类的事件,在那右键选 extend ancestor script
------解决方案--------------------
没见到:setsort() /sort() ,怎么排序呢?
我是这么写的:
C/C++ code
if row<=0 then    //if not ib_cansort then return        String ls_old_sort, ls_column    Char lc_sort    string dw_name,dw_name_text    dw_name=""    dw_name_text=""        IF Right(dwo.Name,2) = '_t' THEN                ls_old_sort = this.Describe("Datawindow.Table.sort")                        dw_name=left(ls_old_sort,len(ls_old_sort) - 2) + "_t"        dw_name_text=this.Describe(dw_name+".text")                    do while pos(dw_name_text,"↑") + pos(dw_name_text,"↓") > 0                     this.modify(dw_name + ".Text ='"+left(dw_name_text,len(dw_name_text) - 2)+"'")            dw_name_text=this.Describe(dw_name+".text")        loop                    ls_column = LEFT(dwo.Name, LEN(String(dwo.Name)) - 2)                    IF ls_column = LEFT(ls_old_sort, LEN(ls_old_sort) - 2) THEN            lc_sort = RIGHT(ls_old_sort, 1)            IF lc_sort = 'A' THEN                lc_sort = 'D'                this.modify (ls_column + "_t.Text ='"+this.Describe(ls_column+"_t.text")+"↓'")                                        ELSE                lc_sort = 'A'                this.modify (ls_column + "_t.Text ='"+this.Describe(ls_column+"_t.text")+"↑'")            END IF            this.SetSort(ls_column+" "+lc_sort)                    ELSE            this.SetSort(ls_column+" A")            this.modify (ls_column + "_t.Text ='"+this.Describe(ls_column+"_t.text")+"↑'")        END IF                this.Sort()                    END IFelse        end if
  相关解决方案