PDA

View Full Version : Ext.isObject is not a function



kelvinl
12 Jun 2009, 10:43 AM
I recently updated my ExtJS framework from 2.1 to 3.0.

When I run the same code I have seen the following error msg in the firebug console:

Ext.isObject is not a function
chrome://firebug/content/blank.gifExt.DomHelper=function(){var u=null,l=/^...(Ext.History,new Ext.util.Observable());
ext-all.js (line 8)
n is not a function
DomHelper()()ext-all.js (line 8)
d()ext-all.js (line 8)

chrome://firebug/content/blank.gifExt.DomHelper=function(){var u=null,l=/^...(Ext.History,new Ext.util.Observable());

Here is the rhtml calling the javascript:

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<link rel="stylesheet" type="text/css" href="../javascripts/ext/resources/css/ext-all.css"/>

<script type="text/javascript" src="../javascripts/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../javascripts/ext/ext-all.js"></script>
<script type="text/javascript" src="../javascripts/compid_script.js"></script>
<link rel="stylesheet" type="text/css" href="../javascripts/ext/style.css" />
<style>
.required .x-form-item-label {font-weight:bold;color:red;}
</style>
</head>
<body>
<center>
<div id = 'grid' ></div>
<center>
</body>
</html>


Here is the javascript that was working in 2.1:

var CompidsDataStore;
var CompidsColumnModel;
var CompidsListingEditorGrid;
var CompidsListingWindow;

var retain_compid;
var retain_releases;
var des;
var retain_lib;
var multiplatforms;
var multireleases;
var is_zos;
var group;
var reviewer_id;
var retrieve_apar;
var defect_option;

var url_address = 'https://websphere.pok.ibm.com/aparshadow/l3portal_admin/process_compid';
var url_address_reviewer = 'https://websphere.pok.ibm.com/aparshadow/l3portal_admin/get_reviewers';
var url_address_update = 'https://websphere.pok.ibm.com/aparshadow/l3portal_admin/update_compid';
var url_address_add = 'https://websphere.pok.ibm.com/aparshadow/l3portal_admin/add_compid';

Ext.onReady(function(){

Ext.QuickTips.init();

//alert('helo');
//execute l3portal_admin.get_reviewers()and retrieves data from reviewers table,
//wrap the data into Json format and store them into ReviewersDataStore object
//For main table reviewer column display only
ReviewersDataStore = new Ext.data.Store({
id: 'ReviewersDataStore',
proxy: new Ext.data.HttpProxy({
url: url_address_reviewer,
method: 'GET'
}),
// baseParams:{task: "getList"}, // this parameter is passed for any HTTP request
reader: new Ext.data.JsonReader({
root: 'result',
totalProperty: 'Total',
id: 'id'
},[
{name: 'id', mapping: 'id'},
{name: 'full_name', mapping: 'full_name'},
{name: 'login_name', mapping: 'login_name'}
]),
sortInfo:{field: 'full_name', direction: "ASC"}
});

//execute l3portal_admin.get_reviewers()and retrieves data from reviewers table,
//wrap the data into Json format and store them into SearchReviewersDataStore object
//For search table reviewer column display
SearchReviewersDataStore = new Ext.data.Store({
id: 'SearchReviewersDataStore',
proxy: new Ext.data.HttpProxy({
url: url_address_reviewer,
method: 'GET'
}),
// baseParams:{task: "getList"}, // this parameter is passed for any HTTP request
reader: new Ext.data.JsonReader({
root: 'result',
totalProperty: 'Total',
id: 'id'
},[
{name: 'id', mapping: 'id'},
{name: 'full_name', mapping: 'full_name'},
{name: 'login_name', mapping: 'login_name'}
]),
sortInfo:{field: 'full_name', direction: "ASC"}
});

ReviewersDataStore.load();
SearchReviewersDataStore.load();


//execute l3portal_admin.process_compid()and pass in "LIST" parameter,
//wrap the data into Json format and store them into CompidsDataStore object
//For main table only
CompidsDataStore = new Ext.data.Store({
id: 'CompidsDataStore',
proxy: new Ext.data.HttpProxy({
url: url_address,
method: 'GET'
}),
baseParams:{task: "LIST"}, // this parameter is passed for any HTTP request
reader: new Ext.data.JsonReader({
root: 'result',
totalProperty: 'Total',
id: 'id'
},[
{name: 'id', mapping: 'id'},
{name: 'retain_compid', mapping: 'retain_compid'},
{name: 'retain_releases', mapping: 'retain_releases'},
{name: 'des', mapping: 'des'},
{name: 'retain_lib', mapping: 'retain_lib'},
{name: 'multiplatforms', mapping: 'multiplatforms'},
{name: 'multireleases', mapping: 'multireleases'},
{name: 'is_zos', mapping: 'is_zos'},
{name: 'group', mapping: 'group'},
{name: 'reviewer_id', mapping: 'reviewer_id'},
{name: 'retrieve_apar', mapping: 'retrieve_apar'},
{name: 'defect_option', mapping: 'defect_option'}
]),
sortInfo:{field: 'id', direction: "ASC"}
});

CompidsColumnModel = new Ext.grid.ColumnModel({
columns: [{
header: '<b>ID',
readOnly: true,
dataIndex: 'id',
align: 'left',
renderer: function(value, cell){ //find out what it does
cell.css = "p";
return value;
},
width: 42
},{
header: '<b>Retain_compid',
dataIndex: 'retain_compid',
align: 'left',
width: 94,
editor: new Ext.form.TextField({
allowBlank: false,
maxLength: 20,
maskRe: /([a-zA-Z0-9\s]+)$/
})
},{
header: '<b>Retain_releases',
dataIndex: 'retain_releases',
align: 'left',
width: 104,
editor: new Ext.form.TextField({
allowBlank: true,
maxLength: 260,
maskRe: /([a-zA-Z0-9\s]+)$/
})
},{
header: '<b>Description',
dataIndex: 'des',
align: 'left',
width: 278,
editor: new Ext.form.TextField({
allowBlank: false,
maxLength: 260,
maskRe: /([a-zA-Z0-9\s]+)$/
})
},{
header: '<b>Retain_library',
dataIndex: 'retain_lib',
width: 88,
align: 'left',
editor: new Ext.form.TextField({
allowBlank: false,
maxLength: 20,
maskRe: /([a-zA-Z0-9\s]+)$/
})
},{
header: '<b>Multiple_releases',
dataIndex: 'multireleases',
align: 'left',
renderer: function(value, cell){
cell.css = "p";
return value;
},
width: 120,
editor: new Ext.form.ComboBox({
id:'multireleases',
fieldLabel: 'multireleases?',
//typeAhead: true,
triggerAction: 'all',
store:new Ext.data.SimpleStore({ //the drop down function
fields:['true', 'false'],
data: [[false,0],[true,1]]}),
mode: 'local',
displayField: 'true',
valueField: 'true',
anchor:'95%',
allowBlank: false,
editable: false,
listClass: 'x-combo-list-small'
})
},{
header: '<b>Multiple_platforms',
dataIndex: 'multiplatforms',
align: 'left',
renderer: function(value, cell){
cell.css = "p";
return value;
},
width: 118,
editor: new Ext.form.ComboBox({
id:'multiplatforms',
fieldLabel: 'multiplatforms?',
//typeAhead: true,
triggerAction: 'all',
store:new Ext.data.SimpleStore({
fields:['true', 'false'],
data: [[false,0],[true,1]]}),
mode: 'local',
displayField: 'true',
valueField: 'true',
anchor:'95%',
allowBlank: false,
editable: false,
listClass: 'x-combo-list-small'
})
},{
header: '<b>is_zos',
readOnly: true,
dataIndex: 'is_zos',
align: 'left',
renderer: function(value, cell){
cell.css = "p";
return value;
},
width: 52,
editor: new Ext.form.ComboBox({
id:'is_zos',
fieldLabel: 'zos?',
//typeAhead: true,
triggerAction: 'all',
store:new Ext.data.SimpleStore({
fields:['true', 'false'],
data: [[false,0],[true,1]]}),
mode: 'local',
displayField: 'true',
valueField: 'true',
anchor:'95%',
allowBlank: false,
editable: false,
listClass: 'x-combo-list-small'
})
},{
header: '<b>Group',
dataIndex: 'group',
align: 'left',
width: 66,
editor: new Ext.form.TextField({
allowBlank: false,
maxLength: 20
//maskRe: /([a-zA-Z0-9\s]+)$/
})
},{
header: '<b>Reviewer',
dataIndex: 'reviewer_id',
align: 'left',
renderer: function(value, cell){
cell.css = "p";
return value;
},
width: 85,
renderer: function(value, p, record, rowIndex, colIndex, ds){ //find out what it is
var val = "";

if (window.CompidsListingEditorGrid != undefined) {
var cm = window.CompidsListingEditorGrid.getColumnModel();
var ce = cm.getCellEditor(colIndex, rowIndex);

if (ce.field.store.getById (value) != undefined) {
val = ce.field.store.getById (value).get ("full_name"); //find out how to retrieve the full name from reviewers table with reviewers id defined in compid table
}
}

return val;
},
editor: new Ext.form.ComboBox({
store: ReviewersDataStore, // call the ReviewersDataStore object and retrieves the value here
displayField:'full_name',
valueField : 'id' , // we have two indexes, ID and Name,
typeAhead: true,
lazyRender:true,
mode: 'local',
triggerAction: 'all',
listWidth:200,
selectOnFocus:false
}),
hidden: false
},{
header: '<b>Retrieve_apar',
dataIndex: 'retrieve_apar',
align: 'left',
renderer: function(value, cell){
cell.css = "p";
return value;
},
width: 88,
editor: new Ext.form.ComboBox({
id:'retrieve_apar',
fieldLabel: 'retrieve apar?',
//typeAhead: true,
triggerAction: 'all',
store:new Ext.data.SimpleStore({
fields:['true', 'false'],
data: [[false,0],[true,1]]}),
mode: 'local',
displayField: 'true',
valueField: 'true',
anchor:'95%',
allowBlank: false,
editable: false,
listClass: 'x-combo-list-small'
})
},{
header: '<b>Defect_option',
dataIndex: 'defect_option',
align: 'left',
width: 86,
editor: new Ext.form.TextField({
allowBlank: false,
maxLength: 20,
maskRe: /([a-zA-Z0-9\s]+)$/
})
}],
defaults: {
sortable: true
}
});
//CompidsColumnModel.defaultSortable= true;

CompidsListingEditorGrid = new Ext.grid.EditorGridPanel({
id: 'CompidsListingEditorGrid',
title: 'Compid Table',
store: CompidsDataStore,
cm: CompidsColumnModel,
enableColLock:false,
clicksToEdit:2,
renderTo:'grid',
width:1279,
height:420,
selModel: new Ext.grid.RowSelectionModel({singleSelect:false}),
bbar: new Ext.PagingToolbar({
pageSize: 20,
store: CompidsDataStore,
displayInfo: true
}),
tbar: [
{
text: 'Add a Compid',
iconCls:'add', // reference to our css
handler: displayFormWindow //calling function displayFormWindow
}, '-', {
text: 'Delete selection',
tooltip: 'Select one entry from below first',
handler: confirmDeleteCompids, // Confirm before deleting
iconCls:'remove'
},'-', { // Added in Tutorial 8
text: 'Search',
tooltip: 'Advanced Search',
handler: startAdvancedSearch,
iconCls:'search'
}
]
});

CompidsDataStore.load({params: {start: 0, limit: 20}});
CompidsListingEditorGrid.on('afteredit', update);

/*CompidsListingWindow = new Ext.Window({
id: 'CompidsListingWindow',
title: 'Compids',
closable:true,
width:994,
height:400,
plain:true,
layout: 'fit',
items: CompidsListingEditorGrid
});

CompidsListingWindow.show();*/



//define variables for create compidIDs, search windows
retain_compid = new Ext.form.TextField({
id: 'retain_compid',
fieldLabel: 'retain_compid',
maxLength: 20,
allowBlank: false,
anchor : '95%',
maskRe: /([a-zA-Z0-9\s]+)$/
});

retain_releases = new Ext.form.TextField({
id: 'retain_releases',
fieldLabel: 'retain_releases',
// maxLength: 20,
allowBlank: true,
anchor : '95%',
maskRe: /([a-zA-Z0-9\s]+)$/
});

des = new Ext.form.TextField({
id: 'des',
fieldLabel: 'des',
maxLength: 40,
allowBlank: false,
anchor : '95%',
maskRe: /([a-zA-Z0-9\s]+)$/
});

retain_lib = new Ext.form.TextField({
id: 'retain_lib',
fieldLabel: 'retain_lib',
maxLength: 20,
allowBlank: false,
anchor : '95%',
maskRe: /([a-zA-Z0-9\s]+)$/
});

multireleases = new Ext.form.ComboBox({
id:'multireleases',
fieldLabel: 'multireleases',
triggerAction: 'all',
store:new Ext.data.SimpleStore({
fields:['true', 'false'],
data: [[false,0],[true,1]]}),
mode: 'local',
displayField: 'true',
valueField: 'true',
anchor:'95%',
allowBlank: true,
editable: false,
listClass: 'x-combo-list-small'
});

multiplatforms = new Ext.form.ComboBox({
id:'multiplatforms',
fieldLabel: 'multiplatforms',
triggerAction: 'all',
store:new Ext.data.SimpleStore({
fields:['true', 'false'],
data: [[false,0],[true,1]]}),
mode: 'local',
displayField: 'true',
valueField: 'true',
anchor:'95%',
allowBlank: false,
editable: false,
listClass: 'x-combo-list-small'
});

is_zos = new Ext.form.ComboBox({
id:'is_zos',
fieldLabel: 'is_zos',
triggerAction: 'all',
store:new Ext.data.SimpleStore({
fields:['true', 'false'],
data: [[false,0],[true,1]]}),
mode: 'local',
displayField: 'true',
valueField: 'true',
anchor:'95%',
allowBlank: false,
editable: false,
listClass: 'x-combo-list-small'
});

group = new Ext.form.TextField({
id: 'group',
fieldLabel: 'group',
maxLength: 20,
allowBlank: false,
anchor : '95%'
//maskRe: /([a-zA-Z0-9\s]+)$/
});

reviewer = new Ext.form.ComboBox({
id: 'reviewer',
fieldLabel: 'reviewer',
store: ReviewersDataStore, // or whatever you've called it
displayField:'full_name',
valueField : 'id', // we have two indexes, ID and Name,
typeAhead: true,
lazyRender:true,
mode: 'local',
triggerAction: 'all',
listWidth:200,
selectOnFocus:false
});

retrieve_apar = new Ext.form.ComboBox({
id:'retrieve_apar',
fieldLabel: 'retrieve_apar',
triggerAction: 'all',
store:new Ext.data.SimpleStore({
fields:['true', 'false'],
data: [[false,0],[true,1]]}),
mode: 'local',
displayField: 'true',
valueField: 'true',
anchor:'95%',
allowBlank: false,
editable: false,
listClass: 'x-combo-list-small'
});

defect_option = new Ext.form.TextField({
id: 'defect_option',
fieldLabel: 'defect_option',
maxLength: 20,
allowBlank: false,
anchor : '95%',
maskRe: /([a-zA-Z0-9\s]+)$/
});


// includes the variables defined above into compid ADD windows
CompidCreateForm = new Ext.FormPanel({
labelAlign: 'top',
bodyStyle:'padding:5px',
width: 600,
items: [{
layout:'column',
border:false,
items:[{
columnWidth:0.5,
layout: 'form',
border:false,
items: [retain_compid, retain_releases, des]
},{
columnWidth:0.5,
layout: 'form',
border:false,
items: [retain_lib, multireleases, multiplatforms]
},{
columnWidth:0.5,
layout: 'form',
border:false,
items: [is_zos, group, reviewer]
},{
columnWidth:0.5,
layout: 'form',
border:false,
items: [retrieve_apar, defect_option]
}]
}],
buttons: [{
text: 'Save and Close',
handler: createCompid
},{
text: 'Cancel',
handler: function(){
// because of the global vars, we can only instantiate one window... so let's just hide it.
CompidCreateWindow.hide();
}
}]
});

CompidCreateWindow= new Ext.Window({
id: 'CompidCreateWindow',
title: 'Creating a New Compid',
closable:true,
width: 620,
height: 370,
plain:true,
layout: 'fit',
items: CompidCreateForm
});

//define variables for create compidIDs, search windows ends

function displayFormWindow(){
if(!CompidCreateWindow.isVisible()){
resetCompidForm();
CompidCreateWindow.show();
} else {
CompidCreateWindow.toFront();
}
}

function resetCompidForm(){
retain_compid.setValue('');
retain_releases.setValue('');
des.setValue('');
retain_lib.setValue('');
multiplatforms.setValue('');
multireleases.setValue('');
is_zos.setValue('');
group.setValue('');
reviewer.setValue('');
retrieve_apar.setValue('');
defect_option.setValue('');
}

//call l3port_admin_controller.add_compid
function createCompid(){
if(isCompidFormValid()){
Ext.Ajax.request({
waitMsg: 'Please wait...',
url: url_address_add,
method: 'GET',
params: {
retain_compid: retain_compid.getValue(),
retain_releases: retain_releases.getValue(),
des: des.getValue(),
retain_lib: retain_lib.getValue(),
multiplatforms: multiplatforms.getValue(),
multireleases: multireleases.getValue(),
is_zos: is_zos.getValue(),
group: group.getValue(),
reviewer_id: reviewer.getValue(),
retrieve_apar: retrieve_apar.getValue(),
defect_option: defect_option.getValue()
},
success: function(response){
var result=eval(response.responseText);

switch(result){
case 1:
Ext.MessageBox.alert('Creation OK','The compid was created successfully.');
CompidsDataStore.reload({params: {start: 0, limit: 20}});
CompidCreateWindow.hide();
break;
default:
Ext.MessageBox.alert('Warning','Could not create the compid.');
break;
}
},
failure: function(response){
var result=response.responseText;
Ext.MessageBox.alert('error','could not connect to the database. retry later');
}
});
} else {
Ext.MessageBox.alert('Warning', 'Your Form is not valid!');
}
}

function isCompidFormValid(){
return(retain_compid.isValid() && retain_releases.isValid() && des.isValid() && retain_lib.isValid() && multiplatforms.isValid() && multireleases.isValid() && is_zos.isValid() && group.isValid() && reviewer.isValid() && retrieve_apar.isValid() && defect_option.isValid());
}






function confirmDeleteCompids(){
if(CompidsListingEditorGrid.selModel.getCount() == 1) // only one entry is selected here
{
Ext.MessageBox.confirm('Confirmation','You are about to delete a compid. Continue?', deleteCompids);
} else if(CompidsListingEditorGrid.selModel.getCount() > 1){
Ext.MessageBox.confirm('Confirmation','Delete this Compid?', deleteCompids);
} else {
Ext.MessageBox.alert('Uh oh...','You can\'t really delete something you haven\'t selected huh?');
}
}

function deleteCompids(btn){
if(btn=='yes'){
var selections = CompidsListingEditorGrid.selModel.getSelections();
var prez = [];
for(i = 0; i< CompidsListingEditorGrid.selModel.getCount(); i++){
prez.push(selections[i].json.id);
}
var encoded_array = Ext.encode(prez);
Ext.Ajax.request({
waitMsg: 'Please wait...',
url: url_address,//_delete_compid,
method: 'GET',
params: {
task: "DELETE",
id: selections[0].json.id//encoded_array
},
success: function(response){
var result=eval(response.responseText);

switch(result){
case 1: // Success : simply reload
CompidsDataStore.reload({params: {start: 0, limit: 20}});
break;
default:
Ext.MessageBox.alert('Warning','Could not delete the entire selection.');
break;
}
},
failure: function(response){
var result=response.responseText;
Ext.MessageBox.alert('error','could not connect to the database. retry later');
}
});
}
}

function startAdvancedSearch(){
// local vars
var CompidSearchForm;
var CompidSearchWindow;
var SearchReviewerItem;
var SearchRetain_compidItem;
var SearchRetain_releasesItem;
var SearchDesItem;
var SearchRetain_libItem;
var SearchMultiplatformsItem;
var SearchMultireleasesItem;
var SearchIs_zosItem;
var SearchGroupItem;
var SearchRetrieve_aparItem;
var SearchRetrieve_aparItem;
var SearchDefect_optionItem;

function listSearch(){
// render according to a SQL date format.
var reviewer_id = "";
if(SearchReviewerItem.getValue() !== "") {
reviewer_id = SearchReviewerItem.getValue();
}

// change the store parameters
CompidsDataStore.baseParams = {
task: 'SEARCH',

retain_compid: SearchRetain_compidItem.getValue(),
retain_releases: SearchRetain_releasesItem.getValue(),
des: SearchDesItem.getValue(),
retain_lib: SearchRetain_libItem.getValue(),
multiplatforms: SearchMultiplatformsItem.getValue(),
multireleases: SearchMultireleasesItem.getValue(),
is_zos: SearchIs_zosItem.getValue(),
group: SearchGroupItem.getValue(),
reviewer_id: SearchReviewerItem.getValue(),
retrieve_apar: SearchRetrieve_aparItem.getValue(),
defect_option: SearchDefect_optionItem.getValue()
};
// Cause the datastore to do another query :
CompidsDataStore.reload({params: {start: 0, limit: 20}});
//CompidSearchWindow.close();
}

function resetSearch(){
// reset the store parameters
CompidsDataStore.baseParams = {
task: 'LIST'
};
// Cause the datastore to do another query :
CompidsDataStore.reload({params: {start: 0, limit: 20}});
CompidSearchWindow.close();
}

SearchReviewerItem = new Ext.form.ComboBox({
id: 'reviewer',
fieldLabel: 'reviewer',
store: SearchReviewersDataStore, // or whatever you've called it
displayField:'full_name',
valueField : 'id', // we have two indexes, ID and Name,
typeAhead: true,
lazyRender:true,
mode: 'local',
triggerAction: 'all',
listWidth:200,
anchor : '95%',
selectOnFocus:false
});

SearchRetain_compidItem = new Ext.form.TextField({
fieldLabel: 'Retain_compid',
maxLength: 20,
anchor : '95%',
maskRe: /([a-zA-Z0-9\s]+)$/
});
SearchRetain_releasesItem = new Ext.form.TextField({
fieldLabel: 'Retain_releases',
maxLength: 20,
anchor : '95%'
//maskRe: /([a-zA-Z0-9\s]+)$/
});
SearchDesItem = new Ext.form.TextField({
fieldLabel: 'Description',
maxLength: 20,
anchor : '95%',
maskRe: /([a-zA-Z0-9\s]+)$/
});
SearchRetain_libItem = new Ext.form.TextField({
fieldLabel: 'Retain_library',
maxLength: 20,
anchor : '95%',
maskRe: /([a-zA-Z0-9\s]+)$/
});
SearchGroupItem = new Ext.form.TextField({
fieldLabel: 'Group',
maxLength: 20,
anchor : '95%'
//maskRe: /([a-zA-Z0-9\s]+)$/
});
SearchDefect_optionItem = new Ext.form.TextField({
fieldLabel: 'Defect_option',
maxLength: 20,
anchor : '95%',
maskRe: /([a-zA-Z0-9\s]+)$/
});
SearchMultiplatformsItem = new Ext.form.ComboBox({
//id:'multiplatforms',
fieldLabel: 'multiplatforms',
triggerAction: 'all',
store:new Ext.data.SimpleStore({
fields:['true', 'false'],
data: [[false,0],[true,1]]}),
mode: 'local',
displayField: 'true',
valueField: 'true',
anchor:'95%',
allowBlank: true,
editable: false,
listClass: 'x-combo-list-small'
});
SearchMultireleasesItem = new Ext.form.ComboBox({
//id:'multiplatforms',
fieldLabel: 'multireleases',
triggerAction: 'all',
store:new Ext.data.SimpleStore({
fields:['true', 'false'],
data: [[false,0],[true,1]]}),
mode: 'local',
displayField: 'true',
valueField: 'true',
anchor:'95%',
allowBlank: true,
editable: false,
listClass: 'x-combo-list-small'
});
SearchIs_zosItem = new Ext.form.ComboBox({
//id:'multiplatforms',
fieldLabel: 'is_zos',
triggerAction: 'all',
store:new Ext.data.SimpleStore({
fields:['true', 'false'],
data: [[false,0],[true,1]]}),
mode: 'local',
displayField: 'true',
valueField: 'true',
anchor:'95%',
allowBlank: true,
editable: false,
listClass: 'x-combo-list-small'
});
SearchRetrieve_aparItem = new Ext.form.ComboBox({
//id:'multiplatforms',
fieldLabel: 'Retrieve_apar',
triggerAction: 'all',
store:new Ext.data.SimpleStore({
fields:['true', 'false'],
data: [[false,0],[true,1]]}),
mode: 'local',
displayField: 'true',
valueField: 'true',
anchor:'95%',
allowBlank: true,
editable: false,
listClass: 'x-combo-list-small'
});

CompidSearchForm = new Ext.FormPanel({
//labelAlign: 'top',
bodyStyle: 'padding: 5px',
width: 600,
items: [{
layout:'column',
border:false,
items:[{
columnWidth:0.5,
layout: 'form',
border:false,
items: [SearchRetain_compidItem, SearchRetain_releasesItem, SearchDesItem]
},{
columnWidth:0.5,
layout: 'form',
border:false,
items: [SearchRetain_libItem, SearchMultiplatformsItem, SearchMultireleasesItem]
},{
columnWidth:0.5,
layout: 'form',
border:false,
items: [SearchIs_zosItem, SearchGroupItem, SearchReviewerItem]
},{
columnWidth:0.5,
layout: 'form',
border:false,
items: [SearchRetrieve_aparItem, SearchDefect_optionItem]
}]
}],
buttons: [{
text: 'Search',
handler: listSearch
},{
text: 'Close',
handler: resetSearch
}]
});


CompidSearchWindow = new Ext.Window({
title: 'Compid Search',
closable:true,
width: 600,
height: 300,
plain:true,
layout: 'fit',
items: CompidSearchForm
});


// once all is done, show the search window
CompidSearchWindow.show();
}
});

//capture edit event in the table and propagate the updated value to the database
function update(oGrid_event){
Ext.Ajax.request({
waitMsg: 'Please wait...',
url: url_address_update,
method: 'GET',
params: {
//task: "Update_compid",
id: oGrid_event.record.data.id,
retain_compid: oGrid_event.record.data.retain_compid,
retain_releases: oGrid_event.record.data.retain_releases,
des: oGrid_event.record.data.des,
retain_lib: oGrid_event.record.data.retain_lib,
multiplatforms: oGrid_event.record.data.multiplatforms,
multireleases: oGrid_event.record.data.multireleases,
is_zos: oGrid_event.record.data.is_zos,
group: oGrid_event.record.data.group,
reviewer_id: oGrid_event.record.data.reviewer_id,
retrieve_apar: oGrid_event.record.data.retrieve_apar,
defect_option: oGrid_event.record.data.defect_option


},
success: function(response){
var result=eval(response.responseText);
switch(result){
case 1:
CompidsDataStore.commitChanges(); // changes successful, get rid of the red triangles
CompidsDataStore.reload({params: {start: 0, limit: 20}}); // reload our datastore.
break;
default:

Ext.MessageBox.alert('Uh uh...','We couldn\'t save it...');
break;
}
},
failure: function(response){

var result=response.responseText;
alert(result);
Ext.MessageBox.alert('error','could not connect to the database. retry later');
}
});
}

tryanDLS
12 Jun 2009, 11:46 AM
http://extjs.com/learn/Ext_Forum_Help#How_to_post_code_properly