Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom field of correlativeTemplate #109

Closed
ichuot opened this issue Nov 12, 2015 · 4 comments
Closed

Custom field of correlativeTemplate #109

ichuot opened this issue Nov 12, 2015 · 4 comments

Comments

@ichuot
Copy link

ichuot commented Nov 12, 2015

@running-coder
Can you add a new option "correlativeField"...?
ex: correlativeField: '{{name}}' or correlativeTemplate: '{{name}}'

@running-coder
Copy link
Owner

Hi Tuan,

could you provide me an example of how the search currently behave with your dataset and how it should be instead? Or give me an example of a case with that option.

ex you are searching for "term" but the displayed result is "x" within these options "x,y,z"

thanks

@ichuot
Copy link
Author

ichuot commented Nov 13, 2015

ex in my case:

...
correlativeTemplate: true,
template: '{{product_name}} <small><em class="text-info">{{price}} - {{in_stock}}</em></small>',
...

I want to limit field searching. eg: {{product_name}} or {{in_stock}}. Not all fields in template.

@running-coder
Copy link
Owner

gotcha, I'll have a look at your PR as soon as I can, meanwhile could you do your PR on the develop branch as the master branch is meant to be the latest released tag, thanks for the contrib!

@running-coder
Copy link
Owner

You can now use boolean or an array of display keys for the correlativeTemplate option

running-coder added a commit that referenced this issue Dec 24, 2015
Features

- Added option ``backdropOnFocus`` will trigger the backdrop option as long as the Typeahead input is focused
- Added ``onShowLayout`` and ``onHideLayout`` callbacks
- ``template`` can now be a function (query, item) that returns a template string
- Added query string sanitization
- Added ``.typeahead-item`` and ``.typeahead-empty`` on list items to easily apply CSS on these LI elements
- #109 ``correlativeTemplate`` can be an array of display keys instead of the complete template
- #111, #127 Added ``filter`` and ``matcher`` options. See the documentation to know the differences and possible return options.
- #115 Added ``e.preventInputChange`` boolean to ``onNavigateBefore`` callback to prevent the input from changing when navigating (arrow up / down) the results
- #118 Every functions and callbacks are now scoped with the Typeahead object, it is possible to use ``this`` to reach the Typeahead variables & functions
- #122 It is now possible to set a custom accent object with ``from`` and ``to``
- #125 Added ``onNavigateAfter`` callback
- #127 ``emptyTemplate`` now accepts a jQuery LI object
- #132 It is now possible to set a function that returns a request object inside ``source.group.url``

Fixes

- Removed ``.show()`` and ``.hide()`` jQuery functions, use the CSS instead!
- Fixed dropdownFilter when clicking outside wouldn't close it
- Fixed jQuery-3.0.0-alpha1 issue, missing the node.selector so using ``options.input`` is now mandatory for using Typeahead['#my-search'] (see extras section in documentation)
- Fixed highlight option when query was empty
- #121 ``selector.hint`` was not being interpreted
running-coder added a commit that referenced this issue Dec 24, 2015
Features

- Added option ``backdropOnFocus`` will trigger the backdrop option as long as the Typeahead input is focused
- Added ``onShowLayout`` and ``onHideLayout`` callbacks
- ``template`` can now be a function (query, item) that returns a template string
- Added query string sanitization
- Added ``.typeahead-item`` and ``.typeahead-empty`` on list items to easily apply CSS on these LI elements
- #109 ``correlativeTemplate`` can be an array of display keys instead of the complete template
- #111, #127 Added ``filter`` and ``matcher`` options. See the documentation to know the differences and possible return options.
- #115 Added ``e.preventInputChange`` boolean to ``onNavigateBefore`` callback to prevent the input from changing when navigating (arrow up / down) the results
- #118 Every functions and callbacks are now scoped with the Typeahead object, it is possible to use ``this`` to reach the Typeahead variables & functions
- #122 It is now possible to set a custom accent object with ``from`` and ``to``
- #125 Added ``onNavigateAfter`` callback
- #127 ``emptyTemplate`` now accepts a jQuery LI object
- #132 It is now possible to set a function that returns a request object inside ``source.group.url``

Fixes

- Removed ``.show()`` and ``.hide()`` jQuery functions, use the CSS instead!
- Fixed dropdownFilter when clicking outside wouldn't close it
- Fixed jQuery-3.0.0-alpha1 issue, missing the node.selector so using ``options.input`` is now mandatory for using Typeahead['#my-search'] (see extras section in documentation)
- Fixed highlight option when query was empty
- #121 ``selector.hint`` was not being interpreted
running-coder added a commit that referenced this issue Dec 24, 2015
Features

- Added option ``backdropOnFocus`` will trigger the backdrop option as long as the Typeahead input is focused
- Added ``onShowLayout`` and ``onHideLayout`` callbacks
- ``template`` can now be a function (query, item) that returns a template string
- Added query string sanitization
- Added ``.typeahead-item`` and ``.typeahead-empty`` on list items to easily apply CSS on these LI elements
- #109 ``correlativeTemplate`` can be an array of display keys instead of the complete template
- #111, #127 Added ``filter`` and ``matcher`` options. See the documentation to know the differences and possible return options.
- #115 Added ``e.preventInputChange`` boolean to ``onNavigateBefore`` callback to prevent the input from changing when navigating (arrow up / down) the results
- #118 Every functions and callbacks are now scoped with the Typeahead object, it is possible to use ``this`` to reach the Typeahead variables & functions
- #122 It is now possible to set a custom accent object with ``from`` and ``to``
- #125 Added ``onNavigateAfter`` callback
- #127 ``emptyTemplate`` now accepts a jQuery LI object
- #132 It is now possible to set a function that returns a request object inside ``source.group.url``

Fixes

- Removed ``.show()`` and ``.hide()`` jQuery functions, use the CSS instead!
- Fixed dropdownFilter when clicking outside wouldn't close it
- Fixed jQuery-3.0.0-alpha1 issue, missing the node.selector so using ``options.input`` is now mandatory for using Typeahead['#my-search'] (see extras section in documentation)
- Fixed highlight option when query was empty
- #121 ``selector.hint`` was not being interpreted
running-coder added a commit that referenced this issue Dec 26, 2015
Features

- Added option ``backdropOnFocus`` will trigger the backdrop option as long as the Typeahead input is focused
- Added ``onShowLayout`` and ``onHideLayout`` callbacks
- ``template`` can now be a function (query, item) that returns a template string
- Added query string sanitization
- Added ``.typeahead-item`` and ``.typeahead-empty`` on list items to easily apply CSS on these LI elements
- Added a resetLayout function
- #109 ``correlativeTemplate`` can be an array of display keys instead of the complete template
- #111, #127 Added ``filter`` and ``matcher`` options. See the documentation to know the differences and possible return options.
- #115 Added ``e.preventInputChange`` boolean to ``onNavigateBefore`` callback to prevent the input from changing when navigating (arrow up / down) the results
- #118 Every functions and callbacks are now scoped with the Typeahead object, it is possible to use ``this`` to reach the Typeahead variables & functions
- #122 It is now possible to set a custom accent object with ``from`` and ``to``
- #125 Added ``onNavigateAfter`` callback
- #127 ``emptyTemplate`` now accepts a jQuery LI object
- #132 It is now possible to set a function that returns a request object inside ``source.group.url``

Fixes

- Removed ``.show()`` and ``.hide()`` jQuery functions, use the CSS instead!
- Fixed dropdownFilter when clicking outside wouldn't close it
- Fixed jQuery-3.0.0-alpha1 issue, missing the node.selector so using ``options.input`` is now mandatory for using Typeahead['#my-search'] (see extras section in documentation)
- Fixed highlight option when query was empty
- Fixed href option where clicking the "a" link wouldn't redirect
- Fixed group search
- #121 ``selector.hint`` was not being interpreted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants