PDA

View Full Version : radiogroup ?? setValues ??????



Tommy1969
20 Jun 2009, 10:53 PM
loadRecord ??setValues ??????????????????
radiogroup ????????????????????????



<html>
<head>
<link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css" />
<script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script>

<script type="text/javascript">
var simple = new Ext.FormPanel({
labelWidth: 75,
frame: true,
title: 'Simple Form',
width: 350,
defaults: {width: 230},
items: [
{xtype:'textfield', name: 'item1', fieldLabel: 'ITEM 1'},
{xtype:'radio', name: 'item2', fieldLabel: 'ITEM 2', boxLabel: 'V1', inputValue:1},
{xtype:'radio', name: 'item2', boxLabel: 'V2', inputValue:2},
{xtype:'radiogroup', fieldLabel: 'ITEM 3', items:[
{name: 'item3', boxLabel: 'VAL1', inputValue:1},
{name: 'item3', boxLabel: 'VAL2', inputValue:2},
]}
],
buttons: [
{text: 'Values', handler: function(btn, evt) {
var str = simple.getForm().getValues(true);
alert(str);
}}
]
});

Ext.onReady(function() {
simple.render(document.body);
simple.getForm().setValues({
item1: 'test',
item2: 2, // ?????????
item3: 2 // ???????????(--;
});
});
</script>
</head>
<body>
</body>
</html>


?????????? getItem ????????????(?)??
????????????????????????????????
?????????????????

Tommy1969
21 Jun 2009, 12:19 AM
????????????? updateRecord ? radiogroup ????????????

radiogroup ??????????????????(--;

integra
22 Jun 2009, 11:40 PM
ExtJS 2.2.1?????????
CheckboxGroup?RadioGroup?setValue????(Ext.emptyFn)????
??????????????????????
?Ext.form.BasicForm#loadRecord (http://extjs.com/deploy/ext-3.0-rc2/docs/source/BasicForm.html#method-Ext.form.BasicForm-loadRecord)?Ext.form.BasicForm#setValues (http://extjs.com/deploy/ext-3.0-rc2/docs/source/BasicForm.html#method-Ext.form.BasicForm-setValues)???????????
???BasicForm#setValues???????setValue???????????????????????

ExtJS 3.0 ?RC2???CheckboxGroup#setValue (http://extjs.com/deploy/ext-3.0-rc2/docs/source/CheckboxGroup.html#method-Ext.form.CheckboxGroup-setValue)?RadioGroup#setValue (http://extjs.com/deploy/ext-3.0-rc2/docs/source/RadioGroup.html#method-Ext.form.RadioGroup-setValue)??????????????????
???????????????????????????

3.0????????????2.2.1???????????3.0??????????????????????????

???????ExtJS3.0??????????????????

Tommy1969
23 Jun 2009, 11:13 AM
??????????????

????????????????? 2.2.1 ???????? 3.0 RC2 ????????????????????????????????????????????????????????????

1. 3.0 ????? setValue ?????????
2. setValue ??????????radiogroup ? name ????????????????
3. ?????????????????????????(--;

# setValue ????????????????????????????????
# ??????????????????????!! >:)