Dec 14, 2011, 1:31 PM
Adding dynamically generated config property and controls to window
Hi,
I am getting my config as a json string at server side along with items(controls) which i want to apply to the window.
The below code works fine:
I am getting my config as a json string at server side along with items(controls) which i want to apply to the window.
The below code works fine:
Ext.onReady(function () {
var config = {
title: "Creating new tender - General description - Step 1/6",
id: 'Window1',
width: 700,
height: 500,
renderTo: Ext.getBody(),
maximizable: true,
minimizable: true,
layout: 'fit',
resizable: true,
autoLoad: true,
items: [{
xtype: 'form',
title: 'Form1'
}]
};
var w = new Ext.Window(config);
w.show();
w.center();
});
but the below code is not working as the Window.Config and Window constructor both doesn't accept string config parameter and i have to implement it on server side:string config = @" {title: 'Creating new tender - General description - Step 1/6',
id: 'Window1',
width: 700,
height: 500,
renderTo: Ext.getBody(),
maximizable: true,
minimizable: true,
layout: 'anchor',
resizable: true,
autoLoad: false,
fieldDefaults: {
msgTarget: 'side',
labelWidth: 75
},
defaultType: 'textfield',
defaults: {
anchor: '100%'
},
items: [{
fieldLabel: 'First Name',
name: 'first',
allowBlank: false
}, {
fieldLabel: 'Last Name',
name: 'last'
}, {
fieldLabel: 'Company',
name: 'company'
}, {
fieldLabel: 'Email',
name: 'email',
vtype: 'email'
}, {
xtype: 'timefield',
fieldLabel: 'Time',
name: 'time',
minValue: '8:00am',
maxValue: '6:00pm'
}]
}";
Ext.Net.Window win = new Ext.Net.Window(config);
Any help is highly appreciated. Thanks in advance.
Last edited by geoffrey.mcgill; Apr 04, 2012 at 10:19 PM.
Reason: please use [CODE] tags