PDA

View Full Version : How to add combobox in html tags



Andr
5 Dec 2011, 2:04 AM
There is a combobox
29795
Need to tags and specials. characters were processed and displayed in the html when you select from the combobox. How can I do?

sachin sachdeva
5 Dec 2011, 2:28 AM
HTML CODE


<div id="searchPanel">
<div class="searchBox">
<input type="text" size="20" name="search" id="search" value="Enter minimum 3 characters..."/>
</div>
</div>

Js code


var search = new Ext.form.ComboBox(
{
store : store,
mode : 'remote',
displayField : 'fileName',
id : 'searchclrid',
typeAhead : false,
loadingText : 'Searching...',
width : 370,
pageSize : 10,
minLength : 0, // 5
maxLength : 250,
hideTrigger : true,
tpl : resultTpl,
emptyText : 'Enter minimum 3 characters...',
applyTo : 'search',
queryParam : 'searchKeyword',
nocache : false,
minChars : 3,
validateOnBlur : true,
forceSelection: false,
autoSelect: false,
allowBlank : true,
enableKeyEvents : true,
selectOnFocus: false
}

Andr
5 Dec 2011, 3:38 AM
I do not understand. Which parameter affects the display of the selected field in the html??
What you need to add in my code:



Ext.ns('Application');

Application.ProductsVerticalsComboBox = Ext.extend(Ext.form.ComboBox, {
//id : 'vertical_id',
fieldLabel : 'Vertical *',
editable : false,
typeAhead : true,
triggerAction : 'all',
mode : 'local',

name : 'vertical_id',
hiddenName : 'vertical_id',

valueField : 'id',
displayField : 'name',


store : new Ext.data.JsonStore({
totalProperty : 'total',
root : 'result',
autoLoad : true,
url : 'products/verticals/options',
fields : [
{
name : 'id',
type : 'int'
},

{
name : 'name',
type : 'string'
},

{
name : 'val',
type : 'int'
}
]
}),

// Allocation of fields where the value of state = disabled.
tpl: [
'<tpl for=".">',
'<div class="x-combo-list-item"',
'<tpl if="val == 0"> style="color: #666666;"</tpl>>',
'{name}',
'</div>',
'</tpl>'
].join(''),


listeners : {
'render' : function() {
this.store.reload();
},
},

initComponent : function() {
Application.ProductsVerticalsComboBox.superclass.initComponent.apply(this, arguments);
}
});

Ext.reg('ProductsVerticalsComboBox', Application.ProductsVerticalsComboBox);