nicobarten
30 Sep 2009, 4:18 AM
Hi all,
I have a form with a fieldset. In this fieldset, normal textfields appear, but when a user logged in has not certain rights, there must be labels instead of textfields.
So i have this code:
// ... some code
layout: 'form',
defaultType: 'textfield',
border: false,
bodyStyle: 'padding: 10px 0px 0px 0px; background-color:#DFE8F6;',
width: 280, // 250 // 290
items: [
{
xtype: 'fieldset',
collapsible: false,
title: 'Persoonlijke gegevens',
autoHeight: true,
defaultType: 'textfield',
items: [
function()
{
var myTest = null;
myTest = new Ext.form.Label(
{
fieldLabel: 'Aanhef',
name: 'aanhef',
width: 128,
text: 'Dhr'
});
return myTest;
} (),
function()
{
var bla = null;
bla = new Ext.form.Label(
{
fieldLabel: 'Voorletters',
name: 'voorletters',
width: 128,
text: 'N.B.'
});
return bla;
} (),
// ... more code
So, in the function for each item, i can decide which will be shown (textfield or label) and then make the current component, and return it. With a textfield or combobox this works good, but the label's value is below the label's fieldlabel, as seen in the picture below:
http://img34.imageshack.us/img34/5783/exampletest.jpg
So what am i doing wrong? (:|
I have a form with a fieldset. In this fieldset, normal textfields appear, but when a user logged in has not certain rights, there must be labels instead of textfields.
So i have this code:
// ... some code
layout: 'form',
defaultType: 'textfield',
border: false,
bodyStyle: 'padding: 10px 0px 0px 0px; background-color:#DFE8F6;',
width: 280, // 250 // 290
items: [
{
xtype: 'fieldset',
collapsible: false,
title: 'Persoonlijke gegevens',
autoHeight: true,
defaultType: 'textfield',
items: [
function()
{
var myTest = null;
myTest = new Ext.form.Label(
{
fieldLabel: 'Aanhef',
name: 'aanhef',
width: 128,
text: 'Dhr'
});
return myTest;
} (),
function()
{
var bla = null;
bla = new Ext.form.Label(
{
fieldLabel: 'Voorletters',
name: 'voorletters',
width: 128,
text: 'N.B.'
});
return bla;
} (),
// ... more code
So, in the function for each item, i can decide which will be shown (textfield or label) and then make the current component, and return it. With a textfield or combobox this works good, but the label's value is below the label's fieldlabel, as seen in the picture below:
http://img34.imageshack.us/img34/5783/exampletest.jpg
So what am i doing wrong? (:|