【问题标题】:Appcelerator performing a manual searchAppcelerator 执行手动搜索
【发布时间】:2017-05-06 16:19:54
【问题描述】:

我有一个搜索栏、表格和一个小键盘(不是真正的键盘)。键盘是手动构建为一堆按钮,屏幕底部带有数字(数字 0-9)。当他们点击一个数字时,它会设置 searchBar.value += 他们点击的那个数字。但是,它实际上并没有执行搜索。是否有某种事件我必须触发才能执行搜索?当我使用实际的键盘时,搜索工作,所以我知道搜索栏是正确实现的。想法?

使用 TI SKD 6.0.4 IOS和安卓操作系统

【问题讨论】:

    标签: android ios search titanium appcelerator


    【解决方案1】:

    【讨论】:

      【解决方案2】:

      你必须触发搜索栏的返回事件

      searchBar.fireEvent('return', {value: YOURVALUE})
      

      【讨论】:

        【解决方案3】:

        看看tableView的filterAttribute属性,见http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView-property-filterAttribute

        在你的 tableView 上设置这个:

        tableView.filterAttribute = 'mySearchText';
        

        然后在你的 tableViewRow 上设置这个:

        tableViewRow.mySearchText = 'searchValue';
        

        现在您可以通过查询 searchBar 来过滤 tableView。您还希望将 mySearchText 属性动态设置为行的内容。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2017-07-27
          • 1970-01-01
          • 1970-01-01
          • 2018-11-25
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多