Beetlejuice
Beetlejuice

Reputation: 4425

Extjs TextField with a store

I want to expand a TextField in a custom control, so that it can hold two fields of my model (an id field and a description field), just like a combo, but in TextField (or TriggerField).

I need too, that when I post a form, the id property be send to server.

Firstly I thing to create a store in this control, but I want to hear more ideas.

thanks.

Upvotes: 1

Views: 1446

Answers (2)

sra
sra

Reputation: 23983

You can extend a combobox with as much buttons as you like. It is quite easy:

provide the CLS

trigger2Cls: 'x-form-clear-trigger'

Note that the number must increment the more buttons you need

Now ExtJS will look for a Trigger handler

onTrigger2Click: function(args){}

That's it. You don't need a new Component for that.

Upvotes: 1

Damask
Damask

Reputation: 1254

Field can't contain two another fields. As you know field contains value. Display value (raw value in Ext terminology) and submitted value (value) may be different.

Direct and reverse convert makes rawToValue and valueToRaw.

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.Base-method-rawToValue

Upvotes: 0

Related Questions