| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1547 人关注过本帖
标题:grid内直接编辑筛选出的部分字段值,几乎卡死,就是转圈。
只看楼主 加入收藏
zhken
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:11
帖 子:283
专家分:616
注 册:2012-9-21
收藏
得分:0 
能否用set key to 锁定范围尝试一下
2022-05-24 20:38
wabc327
Rank: 1
等 级:新手上路
帖 子:60
专家分:0
注 册:2021-2-4
收藏
得分:0 
回复 11楼 zhken
您是说  把set filter to 换成set key to么
2022-05-25 19:09
zhken
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:11
帖 子:283
专家分:616
注 册:2012-9-21
收藏
得分:0 
看下10楼说的,有无帮助
2022-05-25 20:07
wabc327
Rank: 1
等 级:新手上路
帖 子:60
专家分:0
注 册:2021-2-4
收藏
得分:0 
public mcx[5]
mcx[1]=alltrim(upper(thisform.txtdah.value))
mcx[2]=alltrim(thisform.txtyjmlh.value)
mcx[3]=alltrim(thisform.txtxm.value)
mcx[4]=alltrim(thisform.txtcsrq.value)
mcx[5]=alltrim(thisform.txtsfzh.value)

mll=""
mll=mll+' .and. allt(lry)=xyz'
if mcx[1]<>"" then
    mll=mll+' .and. '+"mcx[1] $ dah"
endif
if mcx[2]<>"" then
    if len(alltrim(mcx[2]))=2 .and. alltrim(mcx[2])="1-" .or. alltrim(mcx[2])="2-" .or. alltrim(mcx[2])="3-" .or. alltrim(mcx[2])="4-" .or. alltrim(mcx[2])="5-" .or. alltrim(mcx[2])="6-" .or. alltrim(mcx[2])="7-" .or. alltrim(mcx[2])="8-" .or. alltrim(mcx[2])="9-"
        mll=mll+' .and. '+"mcx[2] $ subs(yjmlh,1,2)"                           
    else   
        mll=mll+' .and. '+"mcx[2] $ yjmlh"   
    endif
endif
if mcx[3]<>"" then
        mll=mll+' .and. '+"mcx[3] $ xm"
endif
if mcx[4]<>"" then
    mll=mll+' .and. '+"mcx[4] $ csrq"
endif
if mcx[5]<>"" then
    mll=mll+' .and. '+"mcx[5] $ sfzh"
endif
if left(mll,6)=" .and." then
    mll=subs(mll,8)
endif

sele b_dagl
set order to dahpxmlh
if mcx[1]#"" .or. mcx[2]#"" .or. mcx[3]#"" .or. mcx[4]#"".or. mcx[5]#"" then
    set filter to &mll
else
    set filter to allt(lry)=xyz
endif
go top
thisform.refresh
thisform.grid1.Column4.enabled=.t.
thisform.grid1.Column5.enabled=.t.
thisform.grid1.Column6.enabled=.t.
thisform.grid1.Column7.enabled=.t.
thisform.grid1.Column8.enabled=.t.
通过以上代码筛选后,直接在grid中修改数据,请问怎样优化以上代码,能在滑动grid滑块时不卡呢,是否与“工具”“选项”设置有关呢
2022-05-26 10:22
wabc327
Rank: 1
等 级:新手上路
帖 子:60
专家分:0
注 册:2021-2-4
收藏
得分:0 
回复 11楼 zhken
SET KEY TO 需要建立索引 我的筛选条件是随意变化的 无法确定关键字建立索引啊
2022-05-26 11:32
zhken
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:11
帖 子:283
专家分:616
注 册:2012-9-21
收藏
得分:0 
或者关掉set filter to 看下卡不卡,如果不卡就要从这里找原因,
又或者用select 来选出你要的条件数,不用set filter 再用新页面进一步加工,看卡不卡
不过数据量大多少会有一点
2022-05-26 13:41
快速回复:grid内直接编辑筛选出的部分字段值,几乎卡死,就是转圈。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014999 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved