kartik-v / yii2-widget-typeahead

Enhanced Yii2 wrapper for the Twitter Typeahead plugin (sub repo split from yii2-widgets).
Other
45 stars 17 forks source link

Returning duplicate results "'dupDetector'" #29

Closed ghost closed 5 years ago

ghost commented 6 years ago

How to fix the duplicate results? I Googled and people suggesed to add 'dupDetector' method to remove duplicate records. I tried the following things but doesn't work

`'dataset' => [ [
'datumTokenizer' => "Bloodhound.tokenizers.obj.whitespace('value')", 'display' => 'value', 'prefetch' => Url::to(['supplier/search']), 'limit' => 10, 'ttl'=> 1, 'remote' => [ 'url' => Url::to(['supplier/search']) . '?q=%QUERY', 'wildcard' => '%QUERY' ], 'dupDetector'=>'function(remoteMatch, localMatch) { return remoteMatch.id === localMatch.id; }'

    ]
]`
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.