ExtJS 4 MVC "Hello World" Application

Posted By Vitaliy | April 30, 2017 | ExtJS 4.0.7
0 277
This is minimal html page code to run ExtJS version 4 with MVC Architecture.
Note: it's recommended to add strict DOCTYPE for this version of library.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<link  href="/ext/4.0.7/resources/css/ext-all.css" rel="stylesheet" />
		<script src="/ext/4.0.7/ext.js"></script>
		<script src="/js/apps/4.0.7/HelloWorld/app.js"></script>
	</head>
	<body></body>
</html>

ExtJS 4.0.7 ComboBox "setValue" Method

Posted By Vitaliy | June 26, 2012 | ExtJS 4.0.7
0 3577
In ExtJS 4.0.7 we can set combobox value by valueField, displayField or an object.
In ExtJS 4.1.0 - only by valueField or displayField.

Reply to thread

Js Code

Ext.widget('form', {
	title: 'Test Form',
	width: 400,
	bodyPadding: 10,
	tbar: [
		{
			text: 'Set value by id',
			handler: function () {
				this.up('form').down('#combo-1').setValue(1);
			}
		},
		{
			text: 'Set value by name',
			handler: function () {
				this.up('form').down('#combo-2').setValue('User-2');
			}
		},
		{
			text: 'Set value by object',
			handler: function () {
				this.up('form').down('#combo-3').setValue({ id: 3, name: 'User-3' });
			}
		}
	],
	items: [
		{
			itemId: 'combo-1',
			fieldLabel: 'By id',
			xtype: 'combouser'
		},
		{
			itemId: 'combo-2',
			fieldLabel: 'By name',
			xtype: 'combouser'
		},
		{
			itemId: 'combo-3',
			fieldLabel: 'By object',
			xtype: 'combouser'
		}
	],
	renderTo: Ext.getBody()
});