PDA

View Full Version : How do I set fieldset 'title' config option to be something from a database?



kevin-berry
27 May 2010, 3:43 PM
I have a fieldset defined as follows. Instead of hardcoding the title to be 'Comments' I want that title to be derived from a database. What is the best solution to this problem?


var Comments =
{
xtype:'fieldset',
title: 'Comments', //Can I make this a variable rather than hardcoding it?
collapsible:true,
autoHeight:true,
items :[{
xtype:'textarea',
labelStyle: 'width:0px',
hideLabel:true,
name: 'meta_data',
id: 'meta_data',
height:75,
width:'100%',
autoScroll:true,
emptyText: 'Add comments here',
}]
};


Currently I can pull the title from the database in a php file like so:



[{"type":"2","form_id":"13","label":"Communities"},
{"type":"6","form_id":"13","label":"Additional Files"}]


So this is similar to my question about populating a CheckboxGroup with boxes from a database, but slightly different. ;)

I want to take that "label" field and plunk that value into the fieldset's 'title' config option.

Thanks for your suggestions!