Author Topic: Password Editing Cell  (Read 2429 times)

kiwon34

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 52
    • View Profile
Password Editing Cell
« on: March 22, 2018, 12:17:18 pm »
Hello ParamQuery,

  How do I make a cell editor in a grid like a password control? I want the data to be displayed like a password. And if possible, I would like only numbers to be input.

Thank you.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6298
    • View Profile
Re: Password Editing Cell
« Reply #1 on: March 22, 2018, 05:21:48 pm »
It can be made into password field by adding attr: "type='password'" to column.editor

Code: [Select]
  editor: { attr:"type='password'" }

Numbers can be enforced by adding dataType:'float' or dataType:'integer' to column.

kiwon34

  • Pro Ultimate
  • Jr. Member
  • *
  • Posts: 52
    • View Profile
Re: Password Editing Cell
« Reply #2 on: March 23, 2018, 06:03:46 am »
Thank you for the reply.

I can see that the cell is displayed as password while typing or focusing, but when it is focused out, the field is shown as plain text.  I want the cell to be displayed always as password type.
What option should I add more?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6298
    • View Profile
Re: Password Editing Cell
« Reply #3 on: March 23, 2018, 10:59:23 am »
column.render can be used for that.

Code: [Select]
render: function(ui){
return (ui.cellData+"").replace(/\d/g,"*");
}