2015-05-25 25 views
0

如何在数据网格中一个接一个地放置搜索结果。我正在使用下面的代码。这是行得通的,但它只显示最后一行(这里f1是主文本字段,f2是搜索字段,我在“f2”中键入一个单词,如果这个单词出现在f1中,那么这行就放在数据网格之后另一个。)如何在datagrid中一个接一个地添加内容

on mouseUp 
    if field "f2" is not empty then 
    put field "f2" into gChar 
    end if 


    local gname 
    put empty into the field "f2" 
    repeat for each line iText in field "f1" 
     if iText contains gChar then 
     put iText after gname 
     set the dgText of group "data" to iText 
    end if 
    end repeat 

    if gname not empty then 

     put gname into the field "f2" 
    end if 

    if field "f2" is empty then 
     put "" into field "f2" 
    end if 

end mouseUp 

回答

相关问题