Alien-Web-ExtJS-V3
view release on metacpan or search on metacpan
share/docs/source/Combo.html view on Meta::CPAN
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The source code</title>
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
<style type="text/css">
.highlight { display: block; background-color: #ddd; }
</style>
<script type="text/javascript">
function highlight() {
document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
}
</script>
</head>
<body onload="prettyPrint(); highlight();">
<pre class="prettyprint lang-js"><span id='Ext-form-ComboBox-method-constructor'><span id='Ext-form-ComboBox'>/**
</span></span> * @class Ext.form.ComboBox
* @extends Ext.form.TriggerField
* <p>A combobox control with support for autocomplete, remote-loading, paging and many other features.</p>
* <p>A ComboBox works in a similar manner to a traditional HTML &lt;select> field. The difference is
* that to submit the {@link #valueField}, you must specify a {@link #hiddenName} to create a hidden input
* field to hold the value of the valueField. The <i>{@link #displayField}</i> is shown in the text field
* which is named according to the {@link #name}.</p>
* <p><b><u>Events</u></b></p>
* <p>To do something when something in ComboBox is selected, configure the select event:<pre><code>
var cb = new Ext.form.ComboBox({
// all of your config options
listeners:{
scope: yourScope,
'select': yourFunction
}
});
// Alternatively, you can assign events after the object is created:
var cb = new Ext.form.ComboBox(yourOptions);
cb.on('select', yourFunction, yourScope);
* </code></pre></p>
*
* <p><b><u>ComboBox in Grid</u></b></p>
* <p>If using a ComboBox in an {@link Ext.grid.EditorGridPanel Editor Grid} a {@link Ext.grid.Column#renderer renderer}
* will be needed to show the displayField when the editor is not active. Set up the renderer manually, or implement
* a reusable render, for example:<pre><code>
// create reusable renderer
Ext.util.Format.comboRenderer = function(combo){
return function(value){
var record = combo.findRecord(combo.{@link #valueField}, value);
return record ? record.get(combo.{@link #displayField}) : combo.{@link #valueNotFoundText};
}
}
// create the combo instance
var combo = new Ext.form.ComboBox({
{@link #typeAhead}: true,
{@link #triggerAction}: 'all',
{@link #lazyRender}:true,
{@link #mode}: 'local',
{@link #store}: new Ext.data.ArrayStore({
id: 0,
fields: [
'myId',
'displayText'
],
data: [[1, 'item1'], [2, 'item2']]
}),
{@link #valueField}: 'myId',
{@link #displayField}: 'displayText'
});
// snippet of column model used within grid
var cm = new Ext.grid.ColumnModel([{
...
},{
header: "Some Header",
dataIndex: 'whatever',
width: 130,
editor: combo, // specify reference to combo instance
renderer: Ext.util.Format.comboRenderer(combo) // pass combo instance to reusable renderer
},
...
( run in 0.816 second using v1.01-cache-2.11-cpan-411bb0df24b )