Convert longhand YAML syntax to shorthand YAML syntax - syntax
I have a YAML file that has been written in the long syntax
children:
-
type: section
subtype: false
title: Top-wrapper
attributes: { }
children:
-
type: section
subtype: false
title: Second-wrapper
attributes: { }
children:
-
type: section
subtype: false
title: Header
attributes: { }
children:
-
type: container
subtype: false
title: Untitled
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 100
children:
-
type: spacer
subtype: false
title: Spacer
attributes:
enabled: 1
children: { }
-
type: section
subtype: false
title: Navigation
attributes: { }
children:
-
type: container
subtype: false
title: Untitled
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 100
children:
-
type: spacer
subtype: false
title: Spacer
attributes:
enabled: 1
children: { }
-
type: section
subtype: false
title: Showcase
attributes: { }
children:
-
type: container
subtype: false
title: Untitled
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 100
children:
-
type: spacer
subtype: false
title: Spacer
attributes:
enabled: 1
children: { }
-
type: section
subtype: false
title: Feature
attributes: { }
children:
-
type: container
subtype: false
title: Untitled
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 100
children:
-
type: spacer
subtype: false
title: Spacer
attributes:
enabled: 1
children: { }
-
type: section
subtype: false
title: Main-content
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 20
children:
-
type: section
subtype: false
title: Sidebar-left
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 100
children:
-
type: position
subtype: false
title: Sidebar-left
attributes:
enabled: 1
key: sidebar-left
title: Sidebar-left
children: { }
-
type: block
subtype: false
title: Untitled
attributes:
size: 60
children:
-
type: section
subtype: false
title: Main
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 100
children:
-
type: pagecontent
subtype: false
title: Pagecontent
attributes:
enabled: 1
children: { }
-
type: block
subtype: false
title: Untitled
attributes:
size: 20
children:
-
type: section
subtype: false
title: Sidebar-right
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 100
children:
-
type: position
subtype: false
title: Sidebar-right
attributes:
enabled: 1
key: sidebar-right
title: Sidebar-right
children: { }
-
type: section
subtype: false
title: Subfeature
attributes: { }
children:
-
type: container
subtype: false
title: Untitled
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 100
children:
-
type: spacer
subtype: false
title: Spacer
attributes:
enabled: 1
children: { }
-
type: section
subtype: false
title: Footer
attributes: { }
children:
-
type: container
subtype: false
title: Untitled
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 100
children:
-
type: spacer
subtype: false
title: Spacer
attributes:
enabled: 1
children: { }
-
type: offcanvas
subtype: false
title: Offcanvas
attributes:
name: 'Offcanvas Section'
children: { }
-
type: atoms
subtype: false
title: Atoms
attributes:
name: 'Atoms Section'
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children: { }
I would like to convert it to use the shorthand syntax similar to this
layout:
1:
- top-wrapper 100:
header:
container:
- spacer
navigation:
container:
- [particle-logo 20, particle-menu 80]
showcase:
container:
- spacer
feature:
container:
- spacer
main:
container:
- system-messages
- pagecontent
footer:
container:
- spacer
debug:
container:
- spacer
offcanvas:
- particle-mobile-menu
I know YAML has certain rules about using the shorthand syntax, how can I use it?
The only way specified in the YAML specification to shorten YAML is by using anchors and references to these anchors (called aliases). Any other shortening would have to be done within the program that uses the data that YAML produces by semantically interpreting specific scalars.
The built-in anchor mechanism is normally used to have YAML documents share original data, e.g. if one mappings is referenced in two places in the hierarchical structure of mappings and sequences. That allows you to rewrite your input as:
children:
-
type: section
subtype: false
title: Top-wrapper
attributes: { }
children:
-
type: section
subtype: false
title: Second-wrapper
attributes: { }
children:
-
type: section
subtype: false
title: Header
attributes: { }
children: &cont00 # <- define anchor for the sequence node
-
type: container
subtype: false
title: Untitled
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 100
children:
-
type: spacer
subtype: false
title: Spacer
attributes:
enabled: 1
children: { }
-
type: section
subtype: false
title: Navigation
attributes: { }
children: *cont00
-
type: section
subtype: false
title: Showcase
attributes: { }
children: *cont00 # <- use the achored node
-
type: section
subtype: false
title: Feature
attributes: { }
children: *cont00 # <- use the anchored node
-
type: section
subtype: false
title: Main-content
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 20
children:
-
type: section
subtype: false
title: Sidebar-left
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 100
children:
-
type: position
subtype: false
title: Sidebar-left
attributes:
enabled: 1
key: sidebar-left
title: Sidebar-left
children: { }
-
type: block
subtype: false
title: Untitled
attributes:
size: 60
children:
-
type: section
subtype: false
title: Main
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 100
children:
-
type: pagecontent
subtype: false
title: Pagecontent
attributes:
enabled: 1
children: { }
-
type: block
subtype: false
title: Untitled
attributes:
size: 20
children:
-
type: section
subtype: false
title: Sidebar-right
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 100
children:
-
type: position
subtype: false
title: Sidebar-right
attributes:
enabled: 1
key: sidebar-right
title: Sidebar-right
children: { }
-
type: section
subtype: false
title: Subfeature
attributes: { }
children: *cont00
-
type: section
subtype: false
title: Footer
attributes: { }
children: *cont00
-
type: offcanvas
subtype: false
title: Offcanvas
attributes:
name: 'Offcanvas Section'
children: { }
-
type: atoms
subtype: false
title: Atoms
attributes:
name: 'Atoms Section'
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children: { }
children:
-
type: section
subtype: false
title: Top-wrapper
attributes: { }
children:
-
type: section
subtype: false
title: Second-wrapper
attributes: { }
children:
-
type: section
subtype: false
title: Header
attributes: { }
children: *cont00
-
type: section
subtype: false
title: Navigation
attributes: { }
children: *cont00
-
type: section
subtype: false
title: Showcase
attributes: { }
children: *cont00
-
type: section
subtype: false
title: Feature
attributes: { }
children: *cont00
-
type: section
subtype: false
title: Main-content
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 20
children:
-
type: section
subtype: false
title: Sidebar-left
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 100
children:
-
type: position
subtype: false
title: Sidebar-left
attributes:
enabled: 1
key: sidebar-left
title: Sidebar-left
children: { }
-
type: block
subtype: false
title: Untitled
attributes:
size: 60
children:
-
type: section
subtype: false
title: Main
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 100
children:
-
type: pagecontent
subtype: false
title: Pagecontent
attributes:
enabled: 1
children: { }
-
type: block
subtype: false
title: Untitled
attributes:
size: 20
children:
-
type: section
subtype: false
title: Sidebar-right
attributes: { }
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children:
-
type: block
subtype: false
title: Untitled
attributes:
size: 100
children:
-
type: position
subtype: false
title: Sidebar-right
attributes:
enabled: 1
key: sidebar-right
title: Sidebar-right
children: { }
-
type: section
subtype: false
title: Subfeature
attributes: { }
children: *cont00
-
type: section
subtype: false
title: Footer
attributes: { }
children: *cont00
-
type: offcanvas
subtype: false
title: Offcanvas
attributes:
name: 'Offcanvas Section'
children: { }
-
type: atoms
subtype: false
title: Atoms
attributes:
name: 'Atoms Section'
children:
-
type: grid
subtype: false
title: Untitled
attributes: { }
children: { }
I.e. you mark a node (and everything underneath) with a &+"unique id"
and you "insert" that same node with *+"unique id"
This is not a rewrite mechanism of the strings, such as the macros in C, and therefore there is no parametrising: the node structure must match exactly for this to work. When reading in such a YAML file you should end up with one object used in two locations.
If you want parametrisation, you would need to create some mechanism for loading (and writing) yourself, and that could further reduce the length of your file, but YAML would not be able to expand that as only your program would know how to do that.
Related
Sencha Ext JS - how to refresh the Tabs after date picking?
I have MVC app, it's a Tab Panel containing few Tabs with a chart on each, there is also a Date Picker with Refresh button, and a Combo box to choose which data source is being used for the 'Date Range'. The app currently loads the charts with all available data but the purpose is to select 1 of 3 available data sources, select a date range and refresh every chart tab by clicking a button, how do I do it? Fiddle sample
Something like this: Ext.create('Ext.panel.Panel', { renderTo: Ext.getBody(), height: 800, width: 800, layout: 'border', defaults: { collapsible: false, split: true, }, items: [{ title: 'PanelCenter', xtype: 'tabpanel', region: 'center', itemId: 'centerPanel', bodyPadding: 10, activeTab: 0, items: [{ title: "Tab1", items: { xtype: 'cartesian', width: 655, height: 400, store: { fields: ['name', 'value'], data: [{ name: 'metric one', value: 10, }, { name: 'metric two', value: 7, }, { name: 'metric three', value: 5, }] }, axes: [{ type: 'numeric', position: 'left', title: { text: 'Sample Values', fontSize: 15 }, }, { type: 'category', position: 'bottom', title: { text: 'Sample Values', fontSize: 15 }, fields: 'name', }], series: [{ type: 'bar', xField: 'name', yField: 'value' } ] } }, { title: "Tab2", items: { xtype: 'cartesian', width: 655, height: 400, store: { fields: ['name', 'value'], data: [{ name: 'metric one', value: 3, }, { name: 'metric two', value: 5, }, { name: 'metric three', value: 10, }] }, axes: [{ type: 'numeric', position: 'left', title: { text: 'Sample Values', fontSize: 15 }, }, { type: 'category', position: 'bottom', title: { text: 'Sample Values', fontSize: 15 }, fields: 'name', }], series: [{ type: 'bar', xField: 'name', yField: 'value' } ] } }, { title: "Tab3", items: { xtype: 'cartesian', width: 655, height: 400, store: { fields: ['name', 'value'], data: [{ name: 'metric one', value: 10, }, { name: 'metric two', value: 3, }, { name: 'metric three', value: 9, }] }, axes: [{ type: 'numeric', position: 'left', title: { text: 'Sample Values', fontSize: 15 }, }, { type: 'category', position: 'bottom', title: { text: 'Sample Values', fontSize: 15 }, fields: 'name', }], series: [{ type: 'bar', xField: 'name', yField: 'value' } ] } }] }, { xtype: 'form', title: 'PanelTop', layout: { type: 'hbox', }, region: 'north', border: false, bodyPadding: 10, height: '100', width: '100%', margin: '0 0 5 0', region: 'north', items: [{ xtype: 'combo', name: 'data_type', itemId: 'dataTypeSelect', emptyText: 'Select date type', displayField: 'source', store: { fields: ['code', 'source'], data: [{ code: 'created', source: 'Sales date' }, { code: 'invoice', source: 'Invoice date' }, { code: 'bookIn', source: 'Order date' }] }, allowBlank: false, }, { xtype: 'datefield', itemId: 'dateFromSearchField', fieldLabel: 'From', labelAlign: 'right', name: 'from_date', format: 'd/m/Y', maxValue: new Date(), allowBlank: false, }, { xtype: 'datefield', itemId: 'dateToSearchField', fieldLabel: 'To', labelAlign: 'right', name: 'to_date', format: 'd/m/Y', maxValue: new Date(), value: new Date(), padding: '0 30 0 0', allowBlank: false }, { xtype: 'button', itemId: 'refreshButton', region: 'center', text: 'Refresh', formBind: true, handler: function () { const formData = this.up('panel').getValues(); if ( formData.data_type && formData.from_date && formData.to_date ) { const tabPanel = Ext.ComponentQuery.query('tabpanel#centerPanel')[0]; const cartesianCharts = tabPanel.query('cartesian'); Ext.Array.each(cartesianCharts, function (cartesianChart) { cartesianChart.getStore().load({ params: formData, callback: function (records, operation, success) { }, scope: this });; }, this); } } }], }] });
Kendo Toolbar Get state of button and reset to load state
I have two question I can't find the answers to; Based on the following: $("#toolbar").kendoToolBar({ items: [ { type: "buttonGroup", id: "FilterControls", buttons: [ { id: "const", text: "Construction", spriteCssClass: "k-icon k-i-funnel", togglable: true, group: "filter", toggle: filterToggleHandler}, { id: "lease", text: "Leasing", spriteCssClass: "k-icon k-i-funnel", togglable: true, group: "filter", toggle: filterToggleHandler }, { id: "legal", text: "Legal", spriteCssClass: "k-icon k-i-funnel", togglable: true, group: "filter", toggle: filterToggleHandler }, { id: "propt", text: "Property Management", spriteCssClass: "k-icon k-i-funnel", togglable: true, group: "filter", toggle: filterToggleHandler } ] }, { id: "mygreens", type: "button", text: "My Greens", spriteCssClass: "k-icon k-i-funnel", togglable: true, toggle: myToggleHandler }, { id: "clear", type: "button", text: "Clear", icon: "funnel-clear", click: filtClearall, togglable: false }, { is: "close", type: "button", text: "Close", spriteCssClass: "k-icon k-i-close", click: retOzone, togglable: false }, ], }); First how from the toggle event of the filter group can I tell the state of the mygreens toogle button and secondly how do I reset the toolbar back to its initial state with no buttons selected, based on the button clear click Cheers
First question: var myGreensFilterActive = $('#mygreens').hasClass('k-state-active'); Second question: filtClearall = function(){ $('#FilterControls>a.k-state-active').removeClass('k-state-active'); //remove filters from data source logic datasource.filter([]); };
Sencha "Card Panel + Data view" makes scrolling impossible
I have a scrolling problem that's driving me crazy. It only happens with card layout, and I tried every possible combination of "scroll" values, withou success. Here is my situation: I have an app with a tab panel attached to Viewport Inside each tab, I need a card layout panel, so I can navigate on each tab independently (each tab is a different section) The problem is: the scrolling works with simple elements like html div's, but if I try to grab a Ext.DataView OR a Ext.List component and scroll, it does not work properly Funny thing: if I grab a DataView (or List), move the mouse a little bit and try to scroll, it works The project is online for you to check: http://gaeti.com/scrollTest/ The code for the troubled card is here: homeCardStart.js Ext.regModel('testModel', { fields: [{ name: 'name', type: 'string' }, { name: 'birthday', type: 'string' }, { name: 'description', type: 'string' }] }); var testStore = new Ext.data.Store({ model: 'testModel', method: 'GET', proxy: { url: 'res/recSample.json', type: 'ajax', reader: { type: 'json', root: 'items', record: 'people', } } }); var testData = new Ext.DataView({ tpl: '<tpl for="."><div class="person">{name}<br>{birthday}<br>{description}</div></tpl></div>', store: testStore, itemSelector: 'div.person', scroll: false, width: 350, autoHeight: true, margin: 20, style: 'border:2px solid magenta' }); testData.on('render', function () { testData.store.load(); }, this); App.views.HomeCardStart = Ext.extend(Ext.Panel, { title: 'Home Start', iconCls: 'home', layout: 'vbox', scroll: 'vertical', style: 'background-color: silver', dockedItems: [{ xtype: 'toolbar', dock: 'top', title: 'Home Start' }], items: [{ html: 'Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>Test<br>', style: 'border:2px solid green', width: 350, autoHeight: true }, testData] }); Ext.reg('homeCardStart', App.views.HomeCardStart); Viewport.js: App.views.Viewport = Ext.extend(Ext.TabPanel, { fullscreen: true, tabBar: { dock: 'bottom', layout: { pack: 'center' } }, id: 'mainTabPanel', defaults: { scroll: 'vertical' }, items: [{ xtype: 'homeCard', id: 'homeCard', cls: 'home' }, { title: 'Mais', iconCls: 'more' }, { title: 'Mais', iconCls: 'more' }, { title: 'Mais', iconCls: 'more' }, { title: 'Mais', iconCls: 'more' }] }); HomeCard.js: App.views.HomeCard = Ext.extend(Ext.Panel, { title: 'Home', iconCls: 'home', layout: 'card', width: '100%', height: '100%', style: 'background-color: green;', items: [{ xtype: 'homeCardStart' }, { xtype: 'panel', title: 'Another card', style: 'background-color: pink' }] }); Ext.reg('homeCard', App.views.HomeCard); What can be happening? Is it a bug? It only happens with card panel (the same bug occurs without a main tab panel outside) Thanks! Leo
The problem you are having is that you are nesting scrollable panels. In your tab panel you set the defaults to always add scroll to each card, and then within that card, the dataview is also scrollable. To fix the issue, you should either turn scrolling off on your dataview, or remove scrolling on your card item. You cannot have both.
Problem with symfony2 schema yaml: unable to get relationships working
I have two entities: User and Student. Following is the yaml schema: ABC\UserBundle\Entity\User: type: entity table: abc_user id: id: { type: integer, generator: { strategy: AUTO } } fields: username: { type: string, length: 255, notnull: true, unique: true } email: { type: string, length: 255, notnull: true, unique: true } password: { type: string, length: 255, notnull: true } enabled: { type: boolean } ABC\UserBundle\Entity\Student: type: entity table: abc_student id: id: { type: integer, generator: { strategy: AUTO } } fields: first_name: { type: string, length: 255, notnull: true } middle_name: { type: string, length: 255 } last_name: { type: string, length: 255, notnull: true } OnetoOne: user: targetEntity: ABC\UserBundle\Entity\User My problem is that when I do "doctine:update:schema --dump-sql", user_id field is not added to the Student table and no relationship is created between the entities.
Yaml map is case-sensitive, use the proper name oneToOne for creating relations.
Your are missing the joinColumn option for the OneToOne association: ABC\UserBundle\Entity\User: type: entity table: abc_user id: id: { type: integer, generator: { strategy: AUTO } } fields: username: { type: string, length: 255, notnull: true, unique: true } email: { type: string, length: 255, notnull: true, unique: true } password: { type: string, length: 255, notnull: true } enabled: { type: boolean } OnetoOne: student: targetEntity: ABC\UserBundle\Entity\Student mappedBy: user ABC\UserBundle\Entity\Student: type: entity table: abc_student id: id: { type: integer, generator: { strategy: AUTO } } fields: first_name: { type: string, length: 255, notnull: true } middle_name: { type: string, length: 255 } last_name: { type: string, length: 255, notnull: true } OnetoOne: user: targetEntity: ABC\UserBundle\Entity\User joinColumn: name: user_id referencedColumnName: id
ExtJS problem with Extended Window, shows in FF not in IE
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.