javascript - TinyMCE: Generate dynamic listbox options list -


i'm developping plugin tinymce , want have listbox on user can select option insert in editor.

this option list not same, depends on actions made on website. values stored in array pass plugin.

i process array format options list:

object.keys(variablesarray).foreach(function (key) {     parameterstext = parameterstext + "{text: '" + variablesarray[key] + "', value: '{{" + key + "}}'},"; }); 

the result good. want declare in listbox:

editor.windowmanager.open({             title: 'insérer variable',             body: [                 {                     type: 'listbox',                      name: 'list_variables',                      label: 'sélectionnez une variable',                          'values': [                             {text: 'numéro de dossier', value: '{{id}}'},                             {text: 'date de l\'accident', value: '{{date_case}}'},                             {text: 'heure de l\'accident', value: '{{time_case}}'},                             {text: 'lieu de l\'accident', value: '{{case_address_1}}, {{case_address_2}}, {{case_postcode}}, {{case_city}}, {{case_country}}'},                             {text: 'description de l\'accident', value: '{{case_description}}'},                             {text: 'date de l\'accident', value: '{{date_case}}'},                             parameterstext,                             {text: '', value: '{{}}'}                 ]}             ], 

but following error: uncaught error: not find control type: {text: '1', value: '{{id}}'},{text: 'mon test', value: '{{test}}'},

that shows me expects proper option , not var. idea how fix ?

thanks in advance time.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -