为什么 checkfield 发送 'on' 而不是 'true' 到服务器 |扩展程序
Why checkfield sends 'on' and not 'true' to the server | Extjs
我有一个带有一堆字段和检查字段的表单:
{
xtype: 'checkboxfield',
fieldLabel: 'Approved?',
name: 'user[approved]',
value: usersShowStore.getData().items[0].data.approved,
},
因此,如果在请求参数中选中复选框,批准的值为 'on'。
Started PUT "/users/3" for 127.0.0.1 at 2016-03-03 16:33:49 +0200
Processing by UsersController#update as */*
Parameters: {"user"=>{"first_name"=>"Test", "last_name"=>"Admin", "approved"=>"on", ...}
如何更改复选框默认行为以发送布尔值?
这是默认值inputValue
:
The value that should go into the generated input element's value
attribute and should be used as the parameter value when submitting as
part of a form.
Defaults to: 'on'
我有一个带有一堆字段和检查字段的表单:
{
xtype: 'checkboxfield',
fieldLabel: 'Approved?',
name: 'user[approved]',
value: usersShowStore.getData().items[0].data.approved,
},
因此,如果在请求参数中选中复选框,批准的值为 'on'。
Started PUT "/users/3" for 127.0.0.1 at 2016-03-03 16:33:49 +0200
Processing by UsersController#update as */*
Parameters: {"user"=>{"first_name"=>"Test", "last_name"=>"Admin", "approved"=>"on", ...}
如何更改复选框默认行为以发送布尔值?
这是默认值inputValue
:
The value that should go into the generated input element's value attribute and should be used as the parameter value when submitting as part of a form.
Defaults to: 'on'