Closed rafaelcor closed 9 years ago
Hi,
The current version only supports one delimiter... But it shouldn't be to hard to put it in yourself if you have the time.
I add support for multiple delimiters. The delimiter parameter can be configured like so.
delimiter: ['@', '#']
In the source function you can check de delimiter used.
source: function (query, process, delimiter) {
// Do your ajax call
// When using multiple delimiters you can alter the query
// depending on the delimiter used
if (delimiter === '@') {
$.getJSON('ajax/users.json', function (data) {
//call process to show the result
process(data)
}
} else {
$.getJSON('ajax/numbers.json', function (data) {
//call process to show the result
process(data)
}
}
@StevenDevooght We can fetch data based on the delimiter in source as shown in above snippet. But can we do the same in render and insert callbacks?. The use case is different layout based on delimiter ( anchor tags for '@' and image tags for ':' )
It's possible to access the delimiter in the render & insert callbacks using the following code:
this.options.delimiter;
Hello, I've a question, this plugin can use multiple delimiters? For example '@' for people and '#' for a number? Thanks