PDA

View Full Version : Some general questions?



businessman332211
29 Jun 2008, 2:11 PM
I have done a lot of studying/using of EXTJS...and some of it's plugins.
There are a few things I don't understand in the API and wanted to find out what they do more specifically. I will link them and if anyone has answers to specific ones I would appreciate it. It's just after reading there API comments + trying to use them I don't understand what these are there for and what exactly they do?
All the ones I have questions about are at..
http://extjs.com/deploy/dev/docs/
and if you drill down to
Api Documentation->Ext->form->ComboBox there all ones that are listed in there. The ones I DO NOT understand are...
1. displayField
2. valuefield
The other one was "Fields" inside of simple store.
The thing I don't get is what Fields is inside of simple store..I just know without that being set to simple store and without teh display/value fields being set the combo box won't work. Normally i just set the 2 "fields" to test 1 and test 2 and then just set thedisplay field to test 1 and value field to test 2 and they start working butI have NO IDEA what those actually do..
Example code of there usage:


new Ext.form.ComboBox ({
fieldLabel: 'Group',
name: 'Group',
store:
new Ext.data.SimpleStore({
fields: ["test", "test2"],
data: [
{{php}}
// get groups
$groups = $this->_tpl_vars['groups'];
// this holds data
$temp = '';
// loops through/gets data
foreach($groups as $k=>$v) {
$temp .= "['".$v."'],";
}
// removes last coma
$temp = substr($temp, 0, strlen($temp)-1);
echo $temp;
{{/php}}
]
}),
mode: 'local',
displayField: 'test',
valueField: ' test2'
})

29 Jun 2008, 3:11 PM
displayField is the data you want to present to the user
valueField is the data you want to send to the server:

Ie:
ID: 1 = valueField
UserName : 'George' = displayField