Trying to have a button push to a different view 'new profile' and 'profile page' (second view) Of course I would have authentication, however just trying to get the views correct before implement the controllers and server side.
Having the following errors:
Uncaught ReferenceError: view is not defined Main.js:116
Uncaught ReferenceError: view is not defined Main.js:126
Google only brings back "ext is not defined" responses.
Forgive the shocking coding as this is my first app for my school assignment (please give feedback how to improve this if possible) I understand that the view needs to be defined, however in the Sencha Touch's API is where I got the information.
Thanks for your time.
var pageFilterGame = {
xtype: 'panel',
title: 'Filter Games',
items: [
{
xtype: 'fieldset',
title: 'Filter games to find the perfect one',
instructions: 'Please fill in atleast one field to start.',
items: [
{
xtype: 'selectfield',
label: 'What enviroment will this game be played in',
options: [
{ text: 'Outside on Grass', value: 'grass' },
{ text: 'Outside on Concrete', value: 'concrete' },
{ text: 'Inside', value: 'inside' }
]
},
{
xtype: 'selectfield',
name: 'equipment',
label: 'What equipment do you have',
options: [{text: 'DB form'}]
},
{
xtype: 'numberfield',
name : 'Player Numbers',
label: 'How many players do you have',
minValue: 2,
maxValue: 50
},
{
xtype: 'numberfield',
name: 'avgname',
label: 'Average age of players',
minValue: 2,
maxValue: 99
},
{
xtype: 'selectfield',
label: 'Sort result by:',
options: [
{ text: 'Highest Rated', value: 'rated' },
{ text: 'Equipment', value: 'equipment' },
{ text: 'Alphabetically', value: 'alpha' }
]
},
],
},
{
xtype: 'button',
ui: 'action',
text: 'Filter Games',
action: '',
maxWidth: '150px'
}
]
};
var pageSearch = {
xtype: 'panel',
title: 'Search',
items: [
{
xtype: 'fieldset',
title: 'Search',
items: [
{
xtype: 'searchfield',
label: 'Search',
name: 'search'
}
]
},
{
xtype: 'button',
ui: 'action',
text: 'Search',
action: '',
maxWidth: '100px'
}
]
};
var pageProfileLogin = {
xtype: 'panel',
title: 'My Profile',
items: [
{
xtype: 'fieldset',
title: 'Please login to access your profile',
items: [
{
xtype: 'textfield',
name : 'username',
label: 'Username'
},
{
xtype: 'passwordfield',
name: 'password',
label: 'Password',
clearIcon: false
}
]
},
{
xtype: 'toolbar',
docked: 'bottom',
items: [
{
text: 'Login',
ui: 'confirm',
handler: function() {
view.push({
title: 'Second View',
padding: 10,
})},
},
{
xtype: 'button',
ui: 'action',
text: 'Create New',
handler: function() {
view.push({
title: 'New Profile',
items: [
{
xtype: 'fieldset',
title: 'Please fill in the form to create your profile',
items: [
{
xtype: 'textfield',
name : 'username',
label: 'Username'
},
{
xtype: 'passwordfield',
name: 'password',
label: 'Password',
clearIcon: false
},
{
xtype: 'textfield',
name : 'name',
label: 'Name'
},
],
},
{
xtype: 'toolbar',
docked: 'bottom',
items: [
{
text: 'Login',
ui: 'confirm',
},
]
}
]
});
}
},
]
},
]}
var viewTabConfig = {
xtype: 'tabpanel',
styleHtmlContent: true,
title: 'Get Creative!',
items: [pageFilterGame, pageSearch, pageProfileLogin]
};
var viewDef = {
//
// Another new UI element introduced. This UI element allows one to add multiple panels in a 'stacked' like operation. A
// new panel when pushed into the NavigationView will be displayed along with a back button. When the back button is tapped,
// the visible view is 'popped' and the parent view gets displayed again. See demo in the lecture recording.
//
extend: 'Ext.NavigationView',
id: 'navView',
requires: [
'Ext.TitleBar',
'Ext.Video',
'Ext.field.Password',
'Ext.field.Select',
'Ext.field.Number',
'Ext.field.Search',
'Ext.form.FieldSet',
'Ext.tab.Panel',
'Ext.data.Store',
'Ext.data.reader.Xml'
],
config: {
fullscreen: true,
items: [viewTabConfig]
}
};
Ext.define("a2.view.Main", viewDef);
I had to add extra models and view to the app.js file and it worked fine.
Related
I am trying to display the items in my panel like that:
I tried to use layout absolute, but like that the text "Device selected" disappear and it is only visible the button "Anzeigen".
Using instead layout column this is the result:
How can I fix the UI so to display the items like in the first picture?
This is my code:
Ext.define('Traccar.view.chart.Chart', {
extend: 'Ext.panel.Panel',
xtype: 'chartView',
requires: [
'Traccar.view.chart.ChartController'
],
layout: 'column',
//layout: 'absolute',
controller: 'chart',
defaults: {
layout: 'form',
xtype: 'container',
defaultType: 'textfield',
},
tbar: {
componentCls: 'toolbar-header-style',
defaults: {
xtype: 'button',
disabled: true,
tooltipType: 'title'
},
items: [{
xtype: 'tbtext',
html: 'Statistics',
baseCls: 'x-panel-header-title-default'
}, {
xtype: 'tbfill',
disabled: false
}, {
handler: 'showMap',
reference: 'showMapButton',
glyph: 'xf279#FontAwesome',
stateful: false,
enableToggle: false,
disabled: false,
tooltip: Strings.centerlisttomap
}]
},
items: [{
xtype: 'label',
id: 'idOpen',
maxWidth: Traccar.Style.formFieldWidth,
reference: 'deviceField',
text: 'Please select one device ',
cls: 'statistic-panel-title-style'
}, {
items: [{
fieldLabel: Strings.reportPeriod,
reference: 'periodField',
xtype: 'combobox',
store: 'ReportPeriods',
disabled: true,
collapseOnSelect: true,
editable: false,
valueField: 'key',
displayField: 'name',
queryMode: 'local',
value: 'today',
listeners: {
change: 'onPeriodChange'
}
}]
}, {
items: [{
xtype: 'fieldcontainer',
layout: 'vbox',
reference: 'fromContainer',
hidden: true,
fieldLabel: Strings.reportFrom,
items: [{
xtype: 'datefield',
reference: 'fromDateField',
startDay: Traccar.Style.weekStartDay,
format: Traccar.Style.dateFormat,
value: new Date()
}, {
xtype: 'customTimeField',
reference: 'fromTimeField',
value: (new Date(new Date().setHours(0, 0, 0, 0)))
}]
}]
}, {
items: [{
xtype: 'fieldcontainer',
layout: 'vbox',
reference: 'toContainer',
hidden: true,
fieldLabel: Strings.reportTo,
items: [{
xtype: 'datefield',
reference: 'toDateField',
startDay: Traccar.Style.weekStartDay,
format: Traccar.Style.dateFormat,
value: (new Date(new Date().setDate(new Date().getDate() + 1)))
}, {
xtype: 'customTimeField',
reference: 'toTimeField',
value: (new Date(new Date().setHours(0, 0, 0, 0)))
}]
}]
}, {
items: [{
xtype: 'button',
reference: 'clearButton',
disabled: true,
text: Strings.clearAllSelections,
tooltipType: 'title',
minWidth: 0,
handler: 'onClearSeletcions'
}]
}, {
items: [{
xtype: 'button',
disabled: true,
reference: 'showButton',
text: Strings.reportShow,
tooltip: Strings.reportShow,
tooltipType: 'title',
minWidth: 0,
handler: 'onShowClick'
}]
}],
});
You can use layout hbox and vbox combinations with some margin on first container.
I skipped 2 hidden views ( don't know where they should be found ).
Ext.define('Traccar.view.chart.Chart', {
extend: 'Ext.panel.Panel',
xtype: 'chartView',
requires: [
'Traccar.view.chart.ChartController'
],
layout: 'vbox',
controller: 'chart',
defaults: {
layout: 'form',
xtype: 'container',
defaultType: 'textfield',
},
tbar: {
componentCls: 'toolbar-header-style',
defaults: {
xtype: 'button',
disabled: true,
tooltipType: 'title'
},
items: [{
xtype: 'tbtext',
html: 'Statistics',
baseCls: 'x-panel-header-title-default'
}, {
xtype: 'tbfill',
disabled: false
}, {
handler: 'showMap',
reference: 'showMapButton',
glyph: 'xf279#FontAwesome',
stateful: false,
enableToggle: false,
disabled: false,
tooltip: Strings.centerlisttomap
}]
},
items: [{
margin: "20 0 20 0",
xtype: 'label',
id: 'idOpen',
maxWidth: Traccar.Style.formFieldWidth,
reference: 'deviceField',
text: 'Please select one device ',
cls: 'statistic-panel-title-style'
}, {
margin: "20 0 20 0",
xtype: 'container',
layout: 'hbox',
items: [{
fieldLabel: Strings.reportPeriod,
reference: 'periodField',
xtype: 'combobox',
store: 'ReportPeriods',
disabled: true,
collapseOnSelect: true,
editable: false,
valueField: 'key',
displayField: 'name',
queryMode: 'local',
value: 'today',
listeners: {
change: 'onPeriodChange'
}
}, {
xtype: 'button',
reference: 'clearButton',
disabled: true,
text: Strings.clearAllSelections,
tooltipType: 'title',
minWidth: 0,
handler: 'onClearSeletcions'
}, {
xtype: 'button',
disabled: true,
reference: 'showButton',
text: Strings.reportShow,
tooltip: Strings.reportShow,
tooltipType: 'title',
minWidth: 0,
handler: 'onShowClick'
}]
}],
});
I am very new to Sencha touch, and I was wondering how i can send post data. I am facing two issues now. 1) I keep getting Uncaught TypeError: undefined is not a function when I attempt to get form data, and 2) how do I post the data to a remote restful api in codeigniter.
My controller now that gives me the error
Ext.define('tileconmob.controller.Main',{
extend:'Ext.app.Controller',
views:['Home','Address','Workers','Firstpage'],
models:['People','Worker'],
config:{
refs:{
loginForm:'#loginform'
},
control:{
'button[action=loginUser]':{
tap:'LoginUser'
}
}
},
LoginUser:function(button,event){
console.log("event in controller was fired");
//console.log(this.referenceList);
var values=this.getloginForm().getValues();
console.log(values);}
});
the view
Ext.define('tileconmob.view.Home', {
extend: 'Ext.Panel',
xtype: 'profilepanel',
config: {
title: 'About us',
iconCls: 'home',
styleHtmlContent: true,
scrollable: true,
items: [{docked: 'top',
xtype: 'titlebar',
title: 'Login'},
{
xtype: 'fieldset',
title: 'About You',
id:'loginform',
items: [{
xtype: 'textfield',
name: 'name',
label: 'Full Name'
},
{
xtype: 'textfield',
name: 'password',
label: 'Password'
},
{
xtype:'button',
ui:'submit',
text:'Login',
action:'loginUser'
}
]
}]
}
});
Working further on this code, it is suppose to post the data to a remote server running with codeigniter rest api. Wish some kind soul can show me the way from here.
Not getting wink to solve this. Found the issue. I am using Ext.panel and i have set the id at the fieldset. After some researching online, fieldset does not come with .getValues(); It is from Ext.form.Panel.
So the final code should be, for the view
Ext.define('tileconmob.view.Home', {
extend: 'Ext.form.Panel',
xtype: 'profilepanel',
id:'loginform',
config: {
title: 'About us',
iconCls: 'home',
styleHtmlContent: true,
scrollable: true,
items: [{docked: 'top',
xtype: 'titlebar',
title: 'Login'},
{
xtype: 'fieldset',
title: 'About You',
items: [{
xtype: 'textfield',
name: 'name',
label: 'Full Name'
},
{
xtype: 'textfield',
name: 'password',
label: 'Password'
},
{
xtype:'button',
ui:'submit',
text:'Login',
action:'loginUser'
}
]
}]
}
});
I'm trying to create a Sencha Touch 2 form panel for a model in which one of the fields contains the URL to an image file. If I include a textfield, it'll display the text of the URL correctly, but what I really want is to display the image found at that URL, and I'm not sure how to do that. If I use xtype: image, I think I need a src config, and I'm not sure how to specify that the desired value is in one of the form fields. My view looks like this:
Ext.define("CatalogApp.view.ItemDetailView", {
extend: "Ext.form.Panel",
requires: "Ext.form.FieldSet",
alias: "widget.itemdetailview",
config:{
scrollable:'vertical'
},
initialize: function ()
{
this.callParent(arguments);
var backButton = {
xtype: "button",
ui: "back",
text: "Home",
handler: this.onBackButtonTap,
scope: this
};
var topToolbar = {
xtype: "toolbar",
docked: "top",
title: "Item Detail",
items: [
backButton
]
};
var mainLayout = {
xtype: "container",
layout: 'hbox',
items: [
{
xtype: 'textfield',
width: 200,
name: 'thumbUrl'
},
{
xtype: "fieldset",
flex: 1,
items : [
{
xtype: 'textfield',
name: 'itemNbr',
label: 'Item Nbr',
disabled: true
},
{
xtype: 'textfield',
name: 'itemDesc',
label: 'Item Desc',
disabled: true
}
]
}
]
};
this.add([
topToolbar,
mainLayout
]);
},
onBackButtonTap: function ()
{
console.log("backToHomeCommand");
this.fireEvent("backToHomeCommand", this);
}
});
How can I set up this view to display the image correctly?
You have to define new Sencha component: ImageField
Ext.define('Ext.ux.field.ImageField', {
extend: 'Ext.field.Field',
requires: [
'Ext.Img'
],
xtype: 'imagefield',
config: {
component: {
xtype: 'image'
}
},
updateValue: function(value, oldValue) {
var me = this,
component = me.getComponent();
component.setSrc(value);
},
proxyConfig: {
width: '100%',
height: '100%'
}
});
Than in form:
Ext.define("CatalogApp.view.ItemDetailView", {
extend: "Ext.form.Panel",
requires: "Ext.form.FieldSet",
alias: "widget.itemdetailview",
config:{
scrollable:'vertical'
},
initialize: function ()
{
this.callParent(arguments);
var backButton = {
xtype: "button",
ui: "back",
text: "Home",
handler: this.onBackButtonTap,
scope: this
};
var topToolbar = {
xtype: "toolbar",
docked: "top",
title: "Item Detail",
items: [
backButton
]
};
var mainLayout = {
xtype: "container",
layout: 'hbox',
items: [
{
xtype: 'imagefield', // only this change
width: 200,
height: 150,
name: 'thumbUrl'
},
{
xtype: "fieldset",
flex: 1,
items : [
{
xtype: 'textfield',
name: 'itemNbr',
label: 'Item Nbr',
disabled: true
},
{
xtype: 'textfield',
name: 'itemDesc',
label: 'Item Desc',
disabled: true
}
]
}
]
};
this.add([
topToolbar,
mainLayout
]);
},
onBackButtonTap: function ()
{
console.log("backToHomeCommand");
this.fireEvent("backToHomeCommand", this);
}
});
Cheers, Oleg
I'm having a dumb problem and I would like you to give me a hand.Thanks in advance.
The situatios is as follows: I have 2 wiews (both created with sencha architect 2.0), one for login, and another for general purposes. And I would like to load the second view on successful response when trying to log in, this is, after any successful login. The main problem is that I've tried with Ex.create, Ext.Viewport.add, Ext.Viewport.setActiveItem, but I can't manage to make the second view to appear on screen, the login screen just keeps there and the app does not load the other view. Another thing, I don't have to use a navigation view for this.
Here is the code of my controller, from which I want to load my second view. And as you'll see, I even created a reference of the view, which has autoCreate enabled and has that ID "mainTabPanel":
Ext.define('MyApp.controller.Login', {
extend: 'Ext.app.Controller',
config: {
refs: {
loginButton: {
selector: '#login',
xtype: 'button'
},
username: {
selector: '#user',
xtype: 'textfield'
},
password: {
selector: '#pass',
xtype: 'passwordfield'
},
mainTabPanel: {
selector: '#mainTabPanel',
xtype: 'tabpanel',
autoCreate: true
}
},
control: {
"loginButton": {
tap: 'onLoginButtonTap'
}
}
},
onLoginButtonTap: function(button, e, options) {
Ext.Ajax.request({
url: '../../backend/auth.php',
method: 'POST',
params: {
user: this.getUsername().getValue(),
pass: this.getPassword().getValue()
},
success: function(response) {
var json = Ext.decode(response.responseText);
if (json.type == 'success') {
// LOAD THE DAMN SECOND VIEW HERE!
//var paneltab = Ext.create('MyApp.view.MainTabPanel');
//Ext.Viewport.add(paneltab);
//Ext.Viewport.setActiveItem(this.getMainTabPanel());
} else {
alert(json.value);
}
},
failure: function(response) {
alert('The request failed!');
}
});
}
});
And here is the code of my login view:
Ext.define('MyApp.view.LoginForm', {
extend: 'Ext.form.Panel',
config: {
id: 'loginForm',
ui: 'light',
items: [
{
xtype: 'fieldset',
ui: 'light',
title: 'Log into the system',
items: [
{
xtype: 'textfield',
id: 'user',
label: 'User',
name: 'user'
},
{
xtype: 'passwordfield',
id: 'pass',
label: 'Pass',
name: 'pass'
}
]
},
{
xtype: 'button',
id: 'login',
ui: 'confirm',
text: 'Login'
}
]
}
});
And finally, the code of the view I want to load. This view loads normally if I set it as the Initial View, but does not load when a successful login occurs:
Ext.define('MyApp.view.MainTabPanel', {
extend: 'Ext.tab.Panel',
config: {
id: 'mainTabPanel',
layout: {
animation: 'slide',
type: 'card'
},
items: [
{
xtype: 'container',
layout: {
type: 'vbox'
},
title: 'Tab 1',
iconCls: 'time',
items: [
{
xtype: 'titlebar',
docked: 'top',
title: 'General Report',
items: [
{
xtype: 'button',
iconCls: 'refresh',
iconMask: true,
text: '',
align: 'right'
}
]
},
{
xtype: 'container',
height: 138,
flex: 1,
items: [
{
xtype: 'datepickerfield',
label: 'From',
placeHolder: 'mm/dd/yyyy'
},
{
xtype: 'datepickerfield',
label: 'To',
placeHolder: 'mm/dd/yyyy'
},
{
xtype: 'numberfield',
label: 'Hours'
}
]
},
{
xtype: 'dataview',
ui: 'dark',
itemTpl: [
'<div style="height:50px; background-color: white; margin-bottom: 1px;">',
' <span style="color: #0000FF">{user}</span>',
' <span>{description}</span>',
'</div>'
],
store: 'hoursStore',
flex: 1
}
]
},
{
xtype: 'container',
title: 'Tab 2',
iconCls: 'maps'
},
{
xtype: 'container',
title: 'Tab 3',
iconCls: 'favorites'
}
],
tabBar: {
docked: 'bottom'
}
}
});
Please, I need help... :)
I'm stuck here for like 3 days now and can't figure out what the problem is. Thank you.
Could you post your app.js too?
I'm trying your code here and it load the view as expected. Here is my app.js:
Ext.application({
name: 'MyApp',
requires: [
'Ext.MessageBox'
],
controllers: ['Login'],
views: ['LoginForm','MainTabPanel'],
icon: {
'57': 'resources/icons/Icon.png',
'72': 'resources/icons/Icon~ipad.png',
'114': 'resources/icons/Icon#2x.png',
'144': 'resources/icons/Icon~ipad#2x.png'
},
isIconPrecomposed: true,
startupImage: {
'320x460': 'resources/startup/320x460.jpg',
'640x920': 'resources/startup/640x920.png',
'768x1004': 'resources/startup/768x1004.png',
'748x1024': 'resources/startup/748x1024.png',
'1536x2008': 'resources/startup/1536x2008.png',
'1496x2048': 'resources/startup/1496x2048.png'
},
launch: function() {
// Destroy the #appLoadingIndicator element
Ext.fly('appLoadingIndicator').destroy();
// Initialize the main view
//Ext.Viewport.add(Ext.create('MyApp.view.Main'));
Ext.Viewport.add(Ext.create('MyApp.view.LoginForm'));
},
onUpdated: function() {
Ext.Msg.confirm(
"Application Update",
"This application has just successfully been updated to the latest version. Reload now?",
function(buttonId) {
if (buttonId === 'yes') {
window.location.reload();
}
}
);
}
});
Destroy the login panel, You don't really need it anymore...
success: function(response) {
var json = Ext.decode(response.responseText);
if (json.type == 'success') {
// LOAD THE DAMN SECOND VIEW HERE!
var paneltab = Ext.create('MyApp.view.MainTabPanel');
Ext.getCmp('loginForm').destroy();
Ext.Viewport.add(paneltab);
} else {
alert(json.value);
}
},
There are several problems here:
Your autoCreate rule uses an xtype: 'tabpanel' which will only ever create a vanilla Ext.TabPanel with no items in it. You'd need to assign an xtype attribute to your MyApp.view.MainTabPanel like xtype: 'mainTabPanel' and then use that xtype value in your autoCreate rule.
This then explains why this code won't work since this.getMainTabPanel() will return the wrong object. Simpler would be to just use Ext.Viewport.setActiveItem(paneltab).
In general, you usually don't want assign an id to a view (id: 'mainTabPanel'). Safer to just use an xtype to fetch it. Although you don't need it in this case, avoiding global id's allows you to create multiple instances of a view (or any other class type).
I get this irritating error message in IE, 'Events is empty or not an object'.
This is my Extended window:
windowKandidaatInfo = Ext.extend(Ext.Window, {
id: 'windowKandidaatInfo',
title: 'Kandidaatinfo',
border: true,
bodyStyle: 'padding: 5px;',
layout: 'fit',
width: 800,
height: 600,
pers_id: 0,
modal: true,
viewConfig: {forceFit: true},
constructor: function(pers_id){
this.pers_id = pers_id;
windowKandidaatInfo.superclass.constructor.call(this);
},
activeTab: function(panel, tab){
tab.getForm().load({
url: '/kandidaten/get_kandidaat_info/' + panel.pers_id + '/',
method: 'get'
});
tab.getForm().on({
actioncomplete: function(form, event){
if(event.type == "load"){
//Data loaded
}
}
})
},
spacerCol: {
colspan: 2,
border: true,
width: 1,
height: 25,
align: 'left'
},
combCountry: {
xtype: 'combo',
name:'land',
fieldLabel: 'Land',
store: new Ext.data.JsonStore({
url: '/index/get_countries/',
method: 'get',
root: 'data',
fields: [{name:'id'},{name:'naam'}],
autoLoad: true
}),
displayField: 'naam',
valueField: 'id',
triggerAction: 'all',
selectOnFocus: true,
typeAhead: true
},
combGeslacht: {
xtype: 'combo',
name:'geslacht',
fieldLabel: 'Geslacht',
store: new Ext.data.JsonStore({
url: '/index/get_geslacht/',
method: 'get',
root: 'data',
fields: [{name:'naam'}],
autoLoad: true
}),
displayField: 'naam',
triggerAction: 'all',
selectOnFocus: true,
typeAhead: true
},
combBurgelijkeStaat: {
xtype: 'combo',
name:'burgelijke_staat',
fieldLabel: 'Burgelijke staat',
store: new Ext.data.JsonStore({
url: '/index/get_burgelijke_staat/',
method: 'get',
root: 'data',
fields: [{name:'naam'}],
autoLoad: true
}),
displayField: 'naam',
triggerAction: 'all',
selectOnFocus: true,
typeAhead: true
},
combProfessions: {
xtype: 'combo',
name:'beroep',
fieldLabel: 'Beroep',
store: new Ext.data.JsonStore({
url: '/index/get_beroepen/',
method: 'get',
root: 'data',
fields: [{name:'beroep'}],
autoLoad: true
}),
displayField: 'beroep',
triggerAction: 'all',
selectOnFocus: true,
typeAhead: true
},
initComponent: function(){
Ext.apply(this, {
items: new Ext.TabPanel({
id: 'tabGeneral',
pers_id: this.pers_id,
activeTab: 0,
items: [
{
title: 'Algemene info',
layout: 'table',
xtype: 'form',
frame: true,
bodyStyle: 'padding: 5px;',
viewConfig: {columns: 2, forceFit: true},
items: [
{
column: .5,
width: 400,
layout: 'form',
items: [
{
layout: 'table',
columns: 2,
items: [
{
layout: 'form',
style: 'margin-right: 5px;',
items: [
{ xtype: 'textfield', width: 40, name: 'voorletters', fieldLabel: 'Voorl/ voornaam'},
]
},
{
layout: 'form',
items: [
{ xtype: 'textfield', width: 200, name: 'voornaam', hideLabel: true}
]
}
]
},
{ xtype: 'textfield', name: 'achternaam', fieldLabel: 'Achternaam'},
{ xtype: 'textfield', name: 'adres', fieldLabel: 'Adres'},
{
layout: 'table',
columns: 2,
items: [
{
layout: 'form',
style: 'margin-right: 5px;',
items:[
{xtype:'textfield', width: 60, name:'postcode', fieldLabel:'Postcode/ plaats'}
]
},
{
layout: 'form',
items: [
{xtype:'textfield', width: 200, name:'plaats', hideLabel: true}
]
}
]
},
this.combCountry,
this.spacerCol,
{ xtype: 'textfield', value: '1900-01-01', format: 'Y-m-d', name: 'geb_datum', fieldLabel: 'Geb. datum'},
{ xtype: 'textfield', name: 'bsn_nummer', fieldLabel: 'Bsn nummer'},
this.combProfessions,
this.spacerCol,
{ xtype: 'textfield', name: 'bedrijfsnaam', fieldLabel: 'Bedrijfsnaam'},
{ xtype: 'textfield', name: 'kvk_naam', fieldLabel: 'KvK naam'},
{ xtype: 'textfield', name: 'kvk_land', fieldLabel: 'KvK land'}
]
},
{
column: .5,
width: 400,
layout: 'form',
items: [
{ xtype: 'textfield', name: 'telefoon', fieldLabel: 'Telefoon'},
{ xtype: 'textfield', name: 'mobiel', fieldLabel: 'Mobiel'},
{ xtype: 'textfield', name: 'fax', fieldLabel: 'Fax'},
{ xtype: 'textfield', width: 200, name: 'email', fieldLabel: 'E-mail'},
{ xtype: 'textfield', width: 200, name: 'website', fieldLabel: 'Website'},
this.spacerCol,
{ xtype: 'textfield', name: 'geb_plaats', fieldLabel: 'Geb. plaats'},
this.combBurgelijkeStaat,
this.combGeslacht,
this.spacerCol,
{ xtype: 'textfield', name: 'btw_nummer', fieldLabel: 'BTW nummer'},
{ xtype: 'textfield', name: 'kvk_plaats', fieldLabel: 'KvK plaats'},
{ xtype: 'textfield', name: 'kvk_nummer', fieldLabel: 'KvK nummer'}
]
}
]
},
{
title: 'Adres info',
xtype: 'form',
layout: 'form',
bodyStyle: 'padding: 5px;'
},
{
title: 'Contact info',
xtype: 'form',
layout: 'form',
bodyStyle: 'padding: 5px;'
}
],
listeners: {
tabchange: this.activeTab
}
})
});
windowKandidaatInfo.superclass.initComponent.call(this);
},
show: function(){
windowKandidaatInfo.superclass.show.apply(this, arguments);
}
});
this is how i call it in a simple JS function:
function showWindow(){
var win = new windowKandidaatInfo(id);
if(win){
win.show();
}}
Why o why is it showing in FF but not in IE?
You have an extra comma on this line.
{ xtype: 'textfield', width: 40, name: 'voorletters', fieldLabel: 'Voorl/ voornaam'},
Firefox is very forgiving with JS syntax where IE isn't. Most of your issues will also probably be due to extra commas. To combat this, I do commas at the beginning of new lines instead of at the end.
So it would be like this.
windowKandidaatInfo = Ext.extend(Ext.Window, {
id: 'windowKandidaatInfo'
,title: 'Kandidaatinfo'
,border: true
,bodyStyle: 'padding: 5px;'
,layout: 'fit'
Try cleaning up your code a bit, there are a few missing semicolons (http://www.jslint.com/).
I worked with extjs some time ago, and had the same problem with a window rendering in Firefox and not in IE. Maybe IE's JS engine is more sensitive to syntactical errors.