如何一个接一个地在datagrid中添加内容

时间:2015-05-25 09:01:42

标签: livecode

我如何将搜索结果一个接一个地放在数据网格中。我使用以下代码。它是有效的,但它只显示最后一行(这里f1是主文本字段,f2是搜索字段。我在“f2”中键入一个字,如果该字存在于f1中,则该行在数据网格中放置一个另一个。)

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

1 个答案:

答案 0 :(得分:1)

随意引用datagrid API,但基本命令是

dispatch" AddData"分组" DataGrid"使用theDataA,theLineNo

以下是datagrid文档的链接。

Shopify's API Documentation

相关问题