projects
/
roojs1
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sync
[roojs1]
/
Roo
/
bootstrap
/
CheckBox.js
diff --git
a/Roo/bootstrap/CheckBox.js
b/Roo/bootstrap/CheckBox.js
index
f6270b2
..
66d9b5f
100644
(file)
--- a/
Roo/bootstrap/CheckBox.js
+++ b/
Roo/bootstrap/CheckBox.js
@@
-66,12
+66,20
@@
Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input, {
tag: 'input',
id : id,
type : this.inputType,
tag: 'input',
id : id,
type : this.inputType,
- value : this.input
Type == 'radio' ? this.inputValue : ((!this.checked) ? this.valueOff : this.inputValue)
,
+ value : this.input
Value
,
cls : 'roo-' + this.inputType, //'form-box',
placeholder : this.placeholder || ''
};
cls : 'roo-' + this.inputType, //'form-box',
placeholder : this.placeholder || ''
};
+
+ var hidden = {
+ tag: 'input',
+ type : 'hidden',
+ cls : 'roo-hidden-value',
+ value : this.checked ? this.valueOff : this.inputValue
+ };
+
if (this.weight) { // Validity check?
cfg.cls += " " + this.inputType + "-" + this.weight;
}
if (this.weight) { // Validity check?
cfg.cls += " " + this.inputType + "-" + this.weight;
}
@@
-82,10
+90,13
@@
Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input, {
if(this.checked){
input.checked = this.checked;
if(this.checked){
input.checked = this.checked;
+
}
}
+
if (this.name) {
if (this.name) {
- input.name = this.name;
+ hidden.name = this.name;
+ input.name = '_hidden_' + this.name;
}
if (this.size) {
}
if (this.size) {
@@
-100,7
+111,13
@@
Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input, {
}
});
}
});
- var inputblock = input;
+ var inputblock = {
+ tag: 'span',
+ cn : [
+ input,
+ hidden
+ ]
+ };
if (this.before || this.after) {
if (this.before || this.after) {
@@
-118,6
+135,7
@@
Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input, {
}
inputblock.cn.push(input);
}
inputblock.cn.push(input);
+ inputblock.cn.push(hidden);
if (this.after) {
inputblock.cn.push({
if (this.after) {
inputblock.cn.push({
@@
-201,6
+219,10
@@
Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input, {
{
return this.el.select('input.roo-' + this.inputType,true).first();
},
{
return this.el.select('input.roo-' + this.inputType,true).first();
},
+ hiddenEl: function ()
+ {
+ return this.el.select('input.hidden-value',true).first();
+ },
labelEl: function()
{
labelEl: function()
{
@@
-267,7
+289,8
@@
Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input, {
this.inputEl().dom.checked = state;
this.inputEl().dom.checked = state;
- this.inputEl().dom.value = state ? this.inputValue : this.valueOff;
+
+ this.hiddenEl().dom.value = state ? this.inputValue : this.valueOff;
if(suppressEvent !== true){
this.fireEvent('check', this, state);
if(suppressEvent !== true){
this.fireEvent('check', this, state);
@@
-282,7
+305,7
@@
Roo.extend(Roo.bootstrap.CheckBox, Roo.bootstrap.Input, {
return this.getGroupValue();
}
return this.getGroupValue();
}
- return this.
inputEl().getValue()
;
+ return this.
hiddenEl() ? this.hiddenEl().dom.value : this.value
;
},
},