dongruan6001 2014-07-31 23:13
浏览 33
已采纳

如何从外部输入过滤并开始?

I'm trying to filter a table content with tablesorter applying two filters at the same time, but the table is not being filtered with filter_startswith when the "filtertext" is being taken from an external input.

The startswith filter works fine when the "filtertext" is from columnFilters, but with the external input the filter works but ignores the startswith filter.

From the source example I added the external input to filter, the rest is almost the same.

Is this an expected behavior or can it be called a bug/error/problem with the widget? How can I make what I want? (filter the table from an external input but with the startswith filter)

Source example: http://mottie.github.io/tablesorter/docs/example-widget-filter.html

  • 写回答

1条回答 默认 最新

  • duanli9569 2014-08-01 01:37
    关注

    I set up this example with the filter_startsWith option set to true and it appears to work when I try to filter the first name column for "a"; the only results I see are "Aaron" and "Alex", not "Philip Aaron" or "Martha".

    $(function() {
    
        $('table').tablesorter({
            theme: 'blue',
            widgets: ['filter'],
            widgetOptions : {
                filter_external : '.search',
                filter_startsWith: true,
                filter_reset: '.reset'
            }
        });
    
    });
    

    If this isn't working for you, then please modify the demo to show the problem so I can help troubleshoot it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 icb slave转ahb master总线设计 能够接入arm busmatrix
  • ¥60 ESP32怎么烧录自启动程序
  • ¥50 html2canvas超出滚动条不显示
  • ¥15 java业务性能问题求解(sql,业务设计相关)
  • ¥15 52810 尾椎c三个a 写蓝牙地址
  • ¥15 elmos524.33 eeprom的读写问题
  • ¥15 使用Java milo连接Kepserver服务端报错?
  • ¥15 用ADS设计一款的射频功率放大器
  • ¥15 怎么求交点连线的理论解?
  • ¥20 软件开发方法学习来了