[英]CellEditing plugin - input type password
My grid uses the plugin Ext.grid.plugin.CellEditing
. 我的网格使用插件Ext.grid.plugin.CellEditing
。
My columns are generated dynamically in relation to my data. 我的列是相对于我的数据动态生成的。
The grid looks like this: 网格如下所示:
...
columns: [],
plugins: [
Ext.create( 'Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
listeners: {
beforeedit: function( oEditor, oOptions ) { ... }
edit: function( oEditor, oOptions ) { ... }
}
} )
...
I am now trying to change the input field type from text
to password
of a single row, where there is a value pass
in column key
. 我现在正在尝试将输入字段的类型从text
password
为单行的password
,其中列key
中有值pass
。
| Key | Value |
__________________|
| id | 5 |
| user | admin |
| pass | **** | <-- this cell should be input type password
___________________
What I tried: 我试过的
Changing the input type via Ext.get( 'textfield-1160-inputEl' ).dom.type = 'password';
通过Ext.get( 'textfield-1160-inputEl' ).dom.type = 'password';
更改输入类型Ext.get( 'textfield-1160-inputEl' ).dom.type = 'password';
in listeners beforeedit
fails since it is not yet rendered. 在监听器中, beforeedit
失败,因为尚未呈现。
How can I achieve that? 我该如何实现?
You can create a custom field to use in the grid: 您可以创建一个自定义字段以在网格中使用:
Ext.define('Ext.form.PasswordField', {
extend: 'Ext.form.field.Base',
alias: 'widget.passwordfield',
inputType: 'password',
});
Which you set as xtype
in grid: 在网格中设置为xtype
的对象:
editor: {
xtype: 'passwordfield',
allowBlank: false,
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.