mohaaron
11 Jun 2009, 2:31 PM
Hello All,
Load the store data first.
valueField - Field 0 from combobox data store.
TextField - Field 1 from combobox data store.
hiddenName - Must be the field/column name of the forms data store/database table.
[NOTE]
I'm am still having a problem with a combo on a tabpanel tab that won't select with the above rules.
[NOTE]
I been reading through all the examples and posts about the subject of adding a ComboBox to a FormPanel and having the form field value bind to the ComboBox item value. I currently have the combo showing up in the form and have been able to populate the combo using a JSonStore with either remote or local mode on the combo. This all works fine. I just can't seem to get the form field value pre-selected in the combo on load.
I'm starting to have a lot of code and I'm going to post all of it so you can see how everthing is organized. I feel like I'm doing something simple wrong just because I don't understand how this is supposed to work.
Does my problem have something to do with how I am loading the form in the grid JSonStore load function? I have the idea the the order in which the data is loaded has a lot to do with how well this works.
The stuff that's commented is what I've tried and didn't work.
Here is the code.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="../Scripts/ext-3.0-rc1.1/resources/css/ext-all.css" />
<script type="text/javascript" src="../Scripts/ext-3.0-rc1.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../Scripts/ext-3.0-rc1.1/ext-all-debug.js"></script>
<script src="../Scripts/dateFormat.js" type="text/javascript"></script>
<style type="text/css">
.x-menu.x-menu-horizontal .x-menu-list {
overflow: hidden;
}
.x-menu.x-menu-horizontal .x-menu-list .x-menu-list-item {
float: left;
}
.x-menu.x-menu-horizontal .x-menu-list .x-menu-list-item .x-menu-item-arrow {
background: url(../Images/horizontal-menu-parent.gif) no-repeat right 9px;
}
</style>
<script type="text/javascript">
Ext.onReady(function() {
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
// Ext.override(Ext.form.ComboBox, {
// setValue: Ext.form.ComboBox.prototype.setValue.createSequence(function(v) {
// var idx = this.store.find(this.valueField, v);
// if (v && this.mode == 'remote' && idx == -1) {
// var p = {};
// p[this.valueField] = v;
// this.store.load({
// scope: this,
// params: p,
// callback: function() {
// this.setValue(v);
// this.collapse();
// }
// });
// }
// })
// });
Ext.override(Ext.menu.Menu, {
onLayout: function() {
if (this.isVisible()) {
if (this.enableScrolling) {
this.constrainScroll(this.el.getTop());
}
if (Ext.isIE) {
this.layout.doAutoSize();
}
if (this.floating) {
this.el.sync();
}
}
}
});
Ext.override(Ext.menu.Menu, {
onClick: function(e) {
var t;
if (t = this.findTargetItem(e)) {
if (t.menu) {
t.expandMenu();
} else {
t.onClick(e);
this.fireEvent("click", this, t, e);
}
}
}
});
var menu = new Ext.menu.Menu({
id: 'basicMenu',
items: [{
text: 'An item',
handler: clickHandler
},
new Ext.menu.Item({
text: 'Another item',
handler: clickHandler
}),
'-',
new Ext.menu.CheckItem({
text: 'A check item',
checkHandler: checkHandler
}),
new Ext.menu.CheckItem({
text: 'Another check item',
checkHandler: checkHandler
})
]
});
var menu2 = new Ext.menu.Menu({
items: [{
text: 'Menu 1, option 1'
}]
});
var mainMenu = new Ext.menu.Menu({
region: 'north',
height: 30,
floating: false,
hidden: false,
enableScrolling: false,
cls: 'x-menu-horizontal',
subMenuAlign: 'tl-bl?',
items: [{
text: 'Our first Menu',
menu: menu // assign our menu to this button
}, {
text: 'Our second Menu',
menu: menu2 // assign our menu to this button
}]
});
function clickHandler() {
alert('Clicked on a menu item');
return;
}
function checkHandler() {
alert('Checked a menu item');
return;
}
function convertDate(v, mix) {
if (v)
return new Date( parseFloat(v.slice(6, 19)) ).format('mm/dd/yyyy').toLocaleString();
}
var currentRecord = null;
var jsonStore = new Ext.data.JsonStore({
url: '/Bugs/GetBugs',
totalProperty: 'totalRows',
root: 'rows',
id: 'NoteId',
fields: [
'NoteId',
'Summary',
{ name: 'DateEntered', convert: convertDate, type: 'date' }
],
listeners: {
load: function(store, records, options) {
try {
// Get an instance of the first record from the data store.
var currentRecord = store.getAt(0);
// Get an instance of the main form.
var form = Ext.getCmp('mainForm');
// Load the main form with the first record.
form.getForm().loadRecord(currentRecord);
} catch(err) {
console.log(err);
}
},
loadexception: function(store, options, response, e) {
console.log(e);
}
}
});
var pagesize = 100;
jsonStore.load({ params: { start: 0, limit: pagesize} });
var summaryGrid = new Ext.grid.GridPanel({
id: 'summaryGrid',
region: 'north',
border: true,
//width: 300,
height: 600,
loadMask: true,
store: jsonStore,
sm: new Ext.grid.RowSelectionModel({
singleSelect: true
,listeners: {
rowselect: function(sm, rowIndex, selectedRecord) {
//console.log(r.data.Summary);
// Overwrite previously selected record with record selected from gird row selection.
currentRecord = selectedRecord;
var form = Ext.getCmp('mainForm');
if (form)
{
form.getForm().loadRecord(selectedRecord);
}
}
}
}),
columns: [
{ header: 'NoteId', width: 80, sortable: true, dataIndex: 'NoteId' },
{ header: 'Summary', width: 300, sortable: true, dataIndex: 'Summary' }
],
bbar: new Ext.PagingToolbar({
pageSize: pagesize,
displayInfo: true,
emptyMsg: 'No data found',
store: jsonStore
})
});
var searchForm = new Ext.FormPanel({
id: 'searchForm',
region: 'center',
labelAlign: 'top',
autoScroll: true,
border: true,
items: [{
xtype: 'textfield',
fieldLabel: 'Search',
name: 'SearchField',
width: 250
}],
buttons: [{
text: 'Search',
handler: function() {
Ext.getCmp('searchForm').getForm().submit({
// Still deciding how this will work.
//url: '/Bugs/Search',
//method: 'POST',
//waitTitle: 'Processing...',
//waitMsg: 'Please wait...'
});
}
}, {
text: 'Clear Search'
}]
});
var leftPanel = new Ext.Panel({
id: 'leftPanel',
region: 'west',
layout: 'border',
border: true,
collapsible: true,
split: true,
width: 300,
items: [ summaryGrid, searchForm ]
});
var productClassStore = new Ext.data.JsonStore({
autoLoad: true,
url: '/Bugs/GetProductClasses',
id: 'PrdClass',
root: 'rows',
fields: ['PrdClass', 'PrdDesc']
});
var productCombo = new Ext.form.ComboBox({
id: 'productCombo',
store: productClassStore,
valueField: 'PrdClass',
displayField: 'PrdDesc',
typeAhead: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
emptyText: 'Select a product',
selectOnFocus: true
});
var mainForm = new Ext.FormPanel({
id: 'mainForm',
region: 'center',
labelAlign: 'top',
layout: 'fit',
border: true,
items: {
xtype: 'tabpanel',
deferredRender: false, // Don't deferr render of tabs so that they are data bound on load.
activeTab: 0,
border: true,
defaults: { autoHeight: true, bodyStyle: 'padding:10px' },
items: [ // Tab Panel Tabs/Items
{ // Tab: F2-General
title: 'F2-General',
layout: 'form',
defaultType: 'textfield',
items: [ // Tab: F2-General Items
{
fieldLabel: 'Summary',
name: 'Summary',
maxLength: 80,
allowBlank: false,
width: 500
}, {
xtype: 'panel',
border: false,
layout: 'column',
width: 600,
items: [{
columnWidth: .5,
layout: 'form',
border: false,
//labelWidth: 120,
items: [{
xtype: 'textfield',
maxLength: 20,
fieldLabel: 'Reported in version',
name: 'Version'
}, {
xtype: 'datefield',
fieldLabel: 'Date modified',
name: 'DateModified',
//format: 'mm/dd/yyy', // Not needed at this time. The date is being formated by the JsonStore.
width: 140
}, {
xtype: 'textfield',
maxLength: 20,
fieldLabel: 'Product class',
name: 'PrdClass'
},
productCombo,
// {
// xtype: 'combo',
// fieldLabel: 'Product class',
// name: 'PrdClass',
// valueField: 'PrdClass',
// displayField: 'PrdDesc',
// typeAhead: true,
// mode: 'local',
// forceSelection: false,
// triggerAction: 'all',
// //emptyText: 'Select a product',
// selectOnFocus: true,
// store: new Ext.data.JsonStore({
// autoLoad: true,
// url: '/Bugs/GetProductClasses',
// id: 'PrdClass',
// root: 'rows',
// fields: ['PrdClass', 'PrdDesc']
// })
// },
{
xtype: 'textfield',
maxLength: 10,
fieldLabel: 'Planned',
name: 'PvVersion'
}, {
xtype: 'textfield',
maxLength: 15,
fieldLabel: 'PV Priority',
name: 'PvPriority'
}, {
xtype: 'textfield',
maxLength: 2,
fieldLabel: 'Assignee',
name: 'AssignedTo'
}, {
xtype: 'textfield',
maxLength: 50,
fieldLabel: 'Menu',
name: 'MenuName'
}]
}, {
columnWidth: .5,
layout: 'form',
border: false,
//labelWidth: 80,
items: [{
xtype: 'textfield',
maxLength: 30,
fieldLabel: 'Reported by',
name: 'ReportedBy'
}, {
xtype: 'textfield',
maxLength: 10,
fieldLabel: 'Verified by',
name: 'VerifiedBy'
}, {
xtype: 'textfield',
maxLength: 30,
fieldLabel: 'Updated by',
name: 'UpdatedBy'
}, {
xtype: 'textfield',
maxLength: 20,
fieldLabel: 'Group',
name: 'PvGroup'
}, {
xtype: 'textfield',
//maxLength: 15,
//type: int,
fieldLabel: 'Priority',
name: 'Priority'
}, {
xtype: 'textfield',
//maxLength: 15,
//type: int,
fieldLabel: 'Seriousness',
name: 'Seriousness'
}]
}]
}, {
xtype: 'panel',
border: false,
layout: 'column',
width: 600,
items: [{
columnWidth: .3,
layout: 'form',
border: false,
labelWidth: 80,
items: [{
xtype: 'checkbox',
fieldLabel: 'Changes Doc',
name: 'IsChangesDoc'
}]
}, {
columnWidth: .3,
layout: 'form',
border: false,
labelWidth: 90,
items: [{
xtype: 'checkbox',
fieldLabel: 'Release Notes',
name: 'IsReleaseNotes'
}]
}, {
columnWidth: .3,
layout: 'form',
border: false,
labelWidth: 100,
items: [{
xtype: 'checkbox',
fieldLabel: 'Known Problems',
name: 'reportedInVersion'
}]
}]
}, {
xtype: 'htmleditor',
fieldLabel: 'Description',
name: 'Description',
height: 200,
anchor: '98%'
}] // END: F2-General Items
}, { // Tab: F3-Programmer Status
title: 'F3-Programmer Status',
layout: 'form',
defaultType: 'textfield',
items: [ // BEGIN: F3-Programmer Status Items
{
xtype: 'htmleditor',
fieldLabel: 'Status',
name: 'Status',
height: 200,
anchor: '98%'
}] // END: F3-Programmer Status Items
}, { // Tab: F4-Solution/Known Problem
title: 'F4-Solution/Known Problem',
layout: 'form',
defaultType: 'textfield',
items: [ // BEGIN: F4-Solution/Known Problem Items
{
xtype: 'htmleditor',
fieldLabel: 'Solution',
name: 'Solution',
height: 200,
anchor: '98%'
}, {
xtype: 'htmleditor',
fieldLabel: 'KnownProb',
name: 'KnownProb',
height: 200,
anchor: '98%'
}] // END: F4-Solution/Known Problem Items
}, { // Tab: F5-Test
title: 'F5-Test',
layout: 'form',
defaultType: 'textfield',
items: [ // BEGIN: F5-Test Items
{
xtype: 'htmleditor',
fieldLabel: 'Status',
name: 'Status',
height: 200,
anchor: '98%'
}] // END: F5-Test Items
}]
},
buttons: [{
text: 'Save',
handler: function() {
Ext.getCmp('mainForm').getForm().submit({
url: '/Bugs/Edit', // The REST based url that the data will be saved to.
method: 'POST',
params: { id: '10' },
waitTitle: 'Processing...',
waitMsg: 'Please wait...'
});
}
}, {
text: 'Cancel'
}]
});
var viewport = new Ext.Viewport({
layout: 'border',
items: [mainMenu, leftPanel, mainForm]
});
})
</script>
</head>
<body>
</body>
</html>
Load the store data first.
valueField - Field 0 from combobox data store.
TextField - Field 1 from combobox data store.
hiddenName - Must be the field/column name of the forms data store/database table.
[NOTE]
I'm am still having a problem with a combo on a tabpanel tab that won't select with the above rules.
[NOTE]
I been reading through all the examples and posts about the subject of adding a ComboBox to a FormPanel and having the form field value bind to the ComboBox item value. I currently have the combo showing up in the form and have been able to populate the combo using a JSonStore with either remote or local mode on the combo. This all works fine. I just can't seem to get the form field value pre-selected in the combo on load.
I'm starting to have a lot of code and I'm going to post all of it so you can see how everthing is organized. I feel like I'm doing something simple wrong just because I don't understand how this is supposed to work.
Does my problem have something to do with how I am loading the form in the grid JSonStore load function? I have the idea the the order in which the data is loaded has a lot to do with how well this works.
The stuff that's commented is what I've tried and didn't work.
Here is the code.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="../Scripts/ext-3.0-rc1.1/resources/css/ext-all.css" />
<script type="text/javascript" src="../Scripts/ext-3.0-rc1.1/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../Scripts/ext-3.0-rc1.1/ext-all-debug.js"></script>
<script src="../Scripts/dateFormat.js" type="text/javascript"></script>
<style type="text/css">
.x-menu.x-menu-horizontal .x-menu-list {
overflow: hidden;
}
.x-menu.x-menu-horizontal .x-menu-list .x-menu-list-item {
float: left;
}
.x-menu.x-menu-horizontal .x-menu-list .x-menu-list-item .x-menu-item-arrow {
background: url(../Images/horizontal-menu-parent.gif) no-repeat right 9px;
}
</style>
<script type="text/javascript">
Ext.onReady(function() {
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
// Ext.override(Ext.form.ComboBox, {
// setValue: Ext.form.ComboBox.prototype.setValue.createSequence(function(v) {
// var idx = this.store.find(this.valueField, v);
// if (v && this.mode == 'remote' && idx == -1) {
// var p = {};
// p[this.valueField] = v;
// this.store.load({
// scope: this,
// params: p,
// callback: function() {
// this.setValue(v);
// this.collapse();
// }
// });
// }
// })
// });
Ext.override(Ext.menu.Menu, {
onLayout: function() {
if (this.isVisible()) {
if (this.enableScrolling) {
this.constrainScroll(this.el.getTop());
}
if (Ext.isIE) {
this.layout.doAutoSize();
}
if (this.floating) {
this.el.sync();
}
}
}
});
Ext.override(Ext.menu.Menu, {
onClick: function(e) {
var t;
if (t = this.findTargetItem(e)) {
if (t.menu) {
t.expandMenu();
} else {
t.onClick(e);
this.fireEvent("click", this, t, e);
}
}
}
});
var menu = new Ext.menu.Menu({
id: 'basicMenu',
items: [{
text: 'An item',
handler: clickHandler
},
new Ext.menu.Item({
text: 'Another item',
handler: clickHandler
}),
'-',
new Ext.menu.CheckItem({
text: 'A check item',
checkHandler: checkHandler
}),
new Ext.menu.CheckItem({
text: 'Another check item',
checkHandler: checkHandler
})
]
});
var menu2 = new Ext.menu.Menu({
items: [{
text: 'Menu 1, option 1'
}]
});
var mainMenu = new Ext.menu.Menu({
region: 'north',
height: 30,
floating: false,
hidden: false,
enableScrolling: false,
cls: 'x-menu-horizontal',
subMenuAlign: 'tl-bl?',
items: [{
text: 'Our first Menu',
menu: menu // assign our menu to this button
}, {
text: 'Our second Menu',
menu: menu2 // assign our menu to this button
}]
});
function clickHandler() {
alert('Clicked on a menu item');
return;
}
function checkHandler() {
alert('Checked a menu item');
return;
}
function convertDate(v, mix) {
if (v)
return new Date( parseFloat(v.slice(6, 19)) ).format('mm/dd/yyyy').toLocaleString();
}
var currentRecord = null;
var jsonStore = new Ext.data.JsonStore({
url: '/Bugs/GetBugs',
totalProperty: 'totalRows',
root: 'rows',
id: 'NoteId',
fields: [
'NoteId',
'Summary',
{ name: 'DateEntered', convert: convertDate, type: 'date' }
],
listeners: {
load: function(store, records, options) {
try {
// Get an instance of the first record from the data store.
var currentRecord = store.getAt(0);
// Get an instance of the main form.
var form = Ext.getCmp('mainForm');
// Load the main form with the first record.
form.getForm().loadRecord(currentRecord);
} catch(err) {
console.log(err);
}
},
loadexception: function(store, options, response, e) {
console.log(e);
}
}
});
var pagesize = 100;
jsonStore.load({ params: { start: 0, limit: pagesize} });
var summaryGrid = new Ext.grid.GridPanel({
id: 'summaryGrid',
region: 'north',
border: true,
//width: 300,
height: 600,
loadMask: true,
store: jsonStore,
sm: new Ext.grid.RowSelectionModel({
singleSelect: true
,listeners: {
rowselect: function(sm, rowIndex, selectedRecord) {
//console.log(r.data.Summary);
// Overwrite previously selected record with record selected from gird row selection.
currentRecord = selectedRecord;
var form = Ext.getCmp('mainForm');
if (form)
{
form.getForm().loadRecord(selectedRecord);
}
}
}
}),
columns: [
{ header: 'NoteId', width: 80, sortable: true, dataIndex: 'NoteId' },
{ header: 'Summary', width: 300, sortable: true, dataIndex: 'Summary' }
],
bbar: new Ext.PagingToolbar({
pageSize: pagesize,
displayInfo: true,
emptyMsg: 'No data found',
store: jsonStore
})
});
var searchForm = new Ext.FormPanel({
id: 'searchForm',
region: 'center',
labelAlign: 'top',
autoScroll: true,
border: true,
items: [{
xtype: 'textfield',
fieldLabel: 'Search',
name: 'SearchField',
width: 250
}],
buttons: [{
text: 'Search',
handler: function() {
Ext.getCmp('searchForm').getForm().submit({
// Still deciding how this will work.
//url: '/Bugs/Search',
//method: 'POST',
//waitTitle: 'Processing...',
//waitMsg: 'Please wait...'
});
}
}, {
text: 'Clear Search'
}]
});
var leftPanel = new Ext.Panel({
id: 'leftPanel',
region: 'west',
layout: 'border',
border: true,
collapsible: true,
split: true,
width: 300,
items: [ summaryGrid, searchForm ]
});
var productClassStore = new Ext.data.JsonStore({
autoLoad: true,
url: '/Bugs/GetProductClasses',
id: 'PrdClass',
root: 'rows',
fields: ['PrdClass', 'PrdDesc']
});
var productCombo = new Ext.form.ComboBox({
id: 'productCombo',
store: productClassStore,
valueField: 'PrdClass',
displayField: 'PrdDesc',
typeAhead: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
emptyText: 'Select a product',
selectOnFocus: true
});
var mainForm = new Ext.FormPanel({
id: 'mainForm',
region: 'center',
labelAlign: 'top',
layout: 'fit',
border: true,
items: {
xtype: 'tabpanel',
deferredRender: false, // Don't deferr render of tabs so that they are data bound on load.
activeTab: 0,
border: true,
defaults: { autoHeight: true, bodyStyle: 'padding:10px' },
items: [ // Tab Panel Tabs/Items
{ // Tab: F2-General
title: 'F2-General',
layout: 'form',
defaultType: 'textfield',
items: [ // Tab: F2-General Items
{
fieldLabel: 'Summary',
name: 'Summary',
maxLength: 80,
allowBlank: false,
width: 500
}, {
xtype: 'panel',
border: false,
layout: 'column',
width: 600,
items: [{
columnWidth: .5,
layout: 'form',
border: false,
//labelWidth: 120,
items: [{
xtype: 'textfield',
maxLength: 20,
fieldLabel: 'Reported in version',
name: 'Version'
}, {
xtype: 'datefield',
fieldLabel: 'Date modified',
name: 'DateModified',
//format: 'mm/dd/yyy', // Not needed at this time. The date is being formated by the JsonStore.
width: 140
}, {
xtype: 'textfield',
maxLength: 20,
fieldLabel: 'Product class',
name: 'PrdClass'
},
productCombo,
// {
// xtype: 'combo',
// fieldLabel: 'Product class',
// name: 'PrdClass',
// valueField: 'PrdClass',
// displayField: 'PrdDesc',
// typeAhead: true,
// mode: 'local',
// forceSelection: false,
// triggerAction: 'all',
// //emptyText: 'Select a product',
// selectOnFocus: true,
// store: new Ext.data.JsonStore({
// autoLoad: true,
// url: '/Bugs/GetProductClasses',
// id: 'PrdClass',
// root: 'rows',
// fields: ['PrdClass', 'PrdDesc']
// })
// },
{
xtype: 'textfield',
maxLength: 10,
fieldLabel: 'Planned',
name: 'PvVersion'
}, {
xtype: 'textfield',
maxLength: 15,
fieldLabel: 'PV Priority',
name: 'PvPriority'
}, {
xtype: 'textfield',
maxLength: 2,
fieldLabel: 'Assignee',
name: 'AssignedTo'
}, {
xtype: 'textfield',
maxLength: 50,
fieldLabel: 'Menu',
name: 'MenuName'
}]
}, {
columnWidth: .5,
layout: 'form',
border: false,
//labelWidth: 80,
items: [{
xtype: 'textfield',
maxLength: 30,
fieldLabel: 'Reported by',
name: 'ReportedBy'
}, {
xtype: 'textfield',
maxLength: 10,
fieldLabel: 'Verified by',
name: 'VerifiedBy'
}, {
xtype: 'textfield',
maxLength: 30,
fieldLabel: 'Updated by',
name: 'UpdatedBy'
}, {
xtype: 'textfield',
maxLength: 20,
fieldLabel: 'Group',
name: 'PvGroup'
}, {
xtype: 'textfield',
//maxLength: 15,
//type: int,
fieldLabel: 'Priority',
name: 'Priority'
}, {
xtype: 'textfield',
//maxLength: 15,
//type: int,
fieldLabel: 'Seriousness',
name: 'Seriousness'
}]
}]
}, {
xtype: 'panel',
border: false,
layout: 'column',
width: 600,
items: [{
columnWidth: .3,
layout: 'form',
border: false,
labelWidth: 80,
items: [{
xtype: 'checkbox',
fieldLabel: 'Changes Doc',
name: 'IsChangesDoc'
}]
}, {
columnWidth: .3,
layout: 'form',
border: false,
labelWidth: 90,
items: [{
xtype: 'checkbox',
fieldLabel: 'Release Notes',
name: 'IsReleaseNotes'
}]
}, {
columnWidth: .3,
layout: 'form',
border: false,
labelWidth: 100,
items: [{
xtype: 'checkbox',
fieldLabel: 'Known Problems',
name: 'reportedInVersion'
}]
}]
}, {
xtype: 'htmleditor',
fieldLabel: 'Description',
name: 'Description',
height: 200,
anchor: '98%'
}] // END: F2-General Items
}, { // Tab: F3-Programmer Status
title: 'F3-Programmer Status',
layout: 'form',
defaultType: 'textfield',
items: [ // BEGIN: F3-Programmer Status Items
{
xtype: 'htmleditor',
fieldLabel: 'Status',
name: 'Status',
height: 200,
anchor: '98%'
}] // END: F3-Programmer Status Items
}, { // Tab: F4-Solution/Known Problem
title: 'F4-Solution/Known Problem',
layout: 'form',
defaultType: 'textfield',
items: [ // BEGIN: F4-Solution/Known Problem Items
{
xtype: 'htmleditor',
fieldLabel: 'Solution',
name: 'Solution',
height: 200,
anchor: '98%'
}, {
xtype: 'htmleditor',
fieldLabel: 'KnownProb',
name: 'KnownProb',
height: 200,
anchor: '98%'
}] // END: F4-Solution/Known Problem Items
}, { // Tab: F5-Test
title: 'F5-Test',
layout: 'form',
defaultType: 'textfield',
items: [ // BEGIN: F5-Test Items
{
xtype: 'htmleditor',
fieldLabel: 'Status',
name: 'Status',
height: 200,
anchor: '98%'
}] // END: F5-Test Items
}]
},
buttons: [{
text: 'Save',
handler: function() {
Ext.getCmp('mainForm').getForm().submit({
url: '/Bugs/Edit', // The REST based url that the data will be saved to.
method: 'POST',
params: { id: '10' },
waitTitle: 'Processing...',
waitMsg: 'Please wait...'
});
}
}, {
text: 'Cancel'
}]
});
var viewport = new Ext.Viewport({
layout: 'border',
items: [mainMenu, leftPanel, mainForm]
});
})
</script>
</head>
<body>
</body>
</html>