简体   繁体   English

CellEditing插件-输入类型密码

[英]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,
}

http://jsfiddle.net/jvtjS/ http://jsfiddle.net/jvtjS/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 网格CellEditing插件 - grid CellEditing plugin Extjs 4 cellEditing插件不适用于多个网格 - Extjs 4 cellEditing plugin doesn't work with more then one grid Extjs CheckboxModel-Checkonly在grid.plugin.CellEditing中不起作用 - Extjs CheckboxModel - Checkonly not working in grid.plugin.CellEditing 在带有CellEditing插件的Ext JS 4网格中,如何以编程方式修改相邻的单元格 - In Ext JS 4 grid with CellEditing plugin how to modify programatically an adjacent cell Extjs 4.1-CellEditing插件中的侦听在第二次不起作用 - Extjs 4.1 - Listerning in CellEditing plugin not working at second time 在ExtJs的CellEditing插件中,如果我们放置安全字符串,那么它将执行 - In the ExtJs's CellEditing plugin if we put security string, then it executes 如何使用CellEditing插件在网格内的组合框中显示属性并在ExtJS 4.2中保存完整的JSON - How to display a property in a combobox within a grid with CellEditing plugin and save a complete JSON in ExtJS 4.2 当插入多列时,Ext JS 4.0 GridPanel CellEditing插件中断 - Ext JS 4.0 GridPanel CellEditing plugin breaks when multiple columns inserted 使用Ext.grid.plugin.CellEditing编辑后远程保存文件 - remote save onblur after edit using Ext.grid.plugin.CellEditing ExtJS 具有功能的网格。分组和编辑插件。具有组合或标签字段的单元格编辑器在单击组时不会关闭编辑器 - ExtJS grid with feature.Grouping and editing plugin.cellediting that has combo or tagfield will not close editor when click on groups
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM