javascript - how to refer to extJS combobox using a string? -


is there way refer via string instance of combobox?
have workaround in place, not happy it, see need create more combobox's in future.
have tried unsuccessfully use 'reference','id','itemid'.

the reason why ask b/c dumping meta information fields , meta-info comes across strings.
works until need javascript instance 'editor'.

i can not refer javascript instance when info has quotes around it.
posting code (just relevant portion) below comment near issue/question/workaround.

var my_combo=ext.create('ext.form.field.combobox', {     listclass: 'x-combo-list-small',     store: ['string', 'int', 'number', 'boolean', 'date'],     querymode: 'local',     displayfield: 'data_type',     valuefield: 'data_type' });  var center_grid = ext.create('ext.grid.panel', {     store: ourrecordstore,     region: 'center',     selmodel: ext.create('ext.selection.checkboxmodel'),     seltype: 'rowmodel',     /*     columns: {{grid_panel_columns|safe}},// <---this not work b/c need use javascript variable, not quoted.      if use string identify data_type_combo object, ideal.     iterating across dictionary , if editor want data_type_combo, have code below use data_type_combo instance     see on next line used (django template), failed when needed add drop downs via combobox.     columns:[{{grid_panel_columns|safe}}]     */     columns: [{% column in grid_panel_columns %}                 {% if column.editor == "data_type_combo" %}                      {'filter': {'type': 'string'},'text': 'data_type', 'dataindex': 'data_type','editor':my_combo},                 {% else %}                     {{column|safe}},                 {% endif %}             {% endfor %}],     }) 

this grid_panel_columns array looks

'grid_panel_columns': [     {'filter': {'type': 'string'}, 'text': 'name', 'dataindex': 'name', 'editor': 'textfield'},      {'filter': {'type': 'string'}, 'text': 'data_type', 'dataindex': 'data_type', 'editor': 'data_type_combo'},      {'filter': {'type': 'string'}, 'text': 'active', 'dataindex': 'active', 'editor': 'textfield'},      {'filter': {'type': 'string'}, 'text': 'id', 'dataindex': 'id'} ],  

i don't know if understand right, want specific combobox editor xtype: 'combo'?

you can define new xtype based on combobox can used editor: 'data_type_combo.

here example fiddle how achieve this: https://fiddle.sencha.com/#fiddle/nup


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -