PDA

View Full Version : Default View-Count



flyingman
5 Aug 2009, 7:55 AM
Hello,

i have a problem with the view-count. In the following code i have defined in the center-region the uiview with count:33 and dateTimeFormat : 'd.m.Y H:i'. This works for the first load. Then y click another view from the outline and there is the count = 40 and the dateTimeFormat : 'd.m.Y H:i A'.
Where can y set the defaults for a view?



Ext.onReady(function(){
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
Ext.QuickTips.init();
viewport = new Ext.Viewport({
layout:'border',
items:[{
region:'north', /* Anwendungstitel und -Icon */
xtype:'box',
el: 'north',
height: 5,
margins:'0 0 0 0'
},{
region:'south', /* Umgebung und Statustexte */
contentEl: 'south',
title:'wo bin ich?',
split:true,
height: 70,
minSize: 70,
maxSize: 70,
collapsible: true,
margins:'0 0 0 0'
},{
region:'center', /* Ansichten und Dokumente in Tabs */
xtype: 'tabpanel',
id: 'center-region',
enableTabScroll: true,
activeTab:0,
defaults:{
target: 'center-region',
border:true
},
items: [{
id: 'ui-view',
layout: 'fit',
xtype: 'xnd-uiview',
viewName:'vwErsteller',
title:'Nach Ersteller',
count: 33,
dateTimeFormats : {
dateFormat : 'd.m.Y',
timeFormat : 'H:i:s',
dateTimeFormat : 'd.m.Y H:i:s'
},
defaults:{
target: 'center-region',
dateTimeFormats : {
dateFormat : 'd.m.Y',
timeFormat : 'H:i:s',
dateTimeFormat : 'd.m.Y H:i:s'
},
count: 33,
closable:true,
border:false
}
}]
},{
region:'east', /* Angaben über Anwender und evt. Application-Owner */
id: 'east-panel',

jratcliff
5 Aug 2009, 2:29 PM
You need to set your defaults on the tabpanel instead of the xnd-uiview. The way 'defaults' are used is that they are applied to each 'child' item. So if you set these defaults on the tabpanel then it will be applied to each child item and thus to each view that is opened.

flyingman
6 Aug 2009, 12:13 AM
Thanks, it works now.

Can I set the first tab of closable:false and all other tabs of closable:true, when the defaults is closbale:true?

Roland

flyingman
6 Aug 2009, 1:12 AM
I found the solution:



defaults:{
target: 'center-region',
dateTimeFormats : {
dateFormat : 'd.m.Y',
timeFormat : 'H:i:s',
dateTimeFormat : 'd.m.Y H:i:s'
},
count: 33,
closable:true,
border:false
},
items: [{
id: 'ui-view',
layout: 'fit',
xtype: 'xnd-uiview',
closable:false,
viewName:'vwErsteller',
title:'nach Ersteller'
}]

jratcliff
6 Aug 2009, 11:21 AM
I found the solution:



defaults:{
target: 'center-region',
dateTimeFormats : {
dateFormat : 'd.m.Y',
timeFormat : 'H:i:s',
dateTimeFormat : 'd.m.Y H:i:s'
},
count: 33,
closable:true,
border:false
},
items: [{
id: 'ui-view',
layout: 'fit',
xtype: 'xnd-uiview',
closable:false,
viewName:'vwErsteller',
title:'nach Ersteller'
}]



Great! Glad you figured it out! :) =D>