There is a text form, where user-entered values ​​are converted into tags (tagsinput). When entering from the bottom, a hint appears (typeahead).

Later I get an array of values ​​from this field and save it to the database. Everything works fine and as needed, but when you click on the hint that appears below or when you press enter (in both cases, the entered value turns into a tag) an error falls to the console:

bootstrap3-typeahead.min.js: 1 Uncaught TypeError: Cannot read property 'apply' of undefined

A bunch of typeahead + tagsinput for this field is configured as follows:

$($myField).tagsinput({ itemValue: 'id', itemText: 'name', typeahead: { displayKey: 'name', source: data['security_list'] } }); 

where 'id', 'name' are the names of the corresponding attributes from the directory that is loaded as JSON.

Wednesday: backbone, everything is divided into modules that are loaded through require. (if data on the environment is generally needed here)

Where to straighten arms?

    0