Author Topic: MaxLength on Columns  (Read 289 times)

pbassey

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 36
    • View Profile
MaxLength on Columns
« on: December 08, 2022, 11:06:55 pm »
I am trying to enforce the MaxLength attribute on specific columns in my grid using the following:

{dataIndx: "Activity", title:'Activity Code', editable: true, width: 110, attr: 'maxlength=10', style: {'border-bottom': '1px dashed #ff0000','border-left': '1px dashed #ff0000', 'border-right': '1px dashed #ff0000','background': '#c6efce'}, styleHead: {'background': '#F4B084', 'color': 'black','font-weight': 'bold'}, hidden:false}

Unfortunately, this attr function is not having any effect.  Can you provide an alternate way to ensure that only 10 characters can be entered in a specific cell/column?

Thanks again...

-P

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: MaxLength on Columns
« Reply #1 on: December 09, 2022, 05:22:16 am »
please add this in column definition:

Code: [Select]
editor:{
type:'textbox',
attr:'maxlength="10"'
},

pbassey

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: MaxLength on Columns
« Reply #2 on: December 09, 2022, 07:00:09 pm »
Thank you!
« Last Edit: December 09, 2022, 07:03:41 pm by pbassey »