Ckeditor4: Pass autocomplete instance to dataCallback from autocomplete's model#setQuery method

Created on 19 Jun 2018  路  4Comments  路  Source: ckeditor/ckeditor4

Feature request

dataCallback function should contain editor instance name info:

https://github.com/ckeditor/ckeditor-dev/blob/adc195906e56169978f7f4b255ecfcae5d5f8c6a/plugins/autocomplete/plugin.js#L1339

While dataCallback usage on top of plugin's level it's hard to understand which editor instance it belongs to. As result it's not able to have 2+ editors with different autocomplete models on the same page.

skip autocomplete confirmed feature

Most helpful comment

@jacekbogdanski let's do our best to include this change in initial 4.10.0 release.

All 4 comments

@DmitrySmolsky that's some early adopter feedback, thanks! 馃檪

Back to the topic, it makes sense. But instead of passing the editor alone, I'd prefer passing Autocomplete instance that was related to that callback.

Having Autocomplete instance you can always access Editor from it's property (autocomplete.editor) - and you'll have access to any other props.

@mlewand, good suggestion.
Autocomplete instance will be ok as well.
Thx

@jacekbogdanski let's do our best to include this change in initial 4.10.0 release.

All right, now the dataCallback signature looks like that:

function dataCallback( matchInfo, callback ) {
}

matchInfo contains following properties:

  • query
  • range
  • autocomplete

It will be presented in a nicer way after release in our CKEditor4 API docs.

Was this page helpful?
0 / 5 - 0 ratings