EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: jaimi on October 29, 2014, 08:21:11 PM



Title: edatagrid maxlength of input
Post by: jaimi on October 29, 2014, 08:21:11 PM
Hi, I have a numberbox within a edatagrid like this:

$('#edgGLL').edatagrid({
 title : 'Ländercode-Tabelle',
  iconCls:'icon-Database',
  width:'100%', 
  height:'auto',
  collapsible: 'true',
  columns:[[ 
    {field:'OLT00L001T_KEY',title:'OLT00L001T_KEY',width:120,sortable:'true'}
   ,{ field   :'GLL_NUM'
     ,title   :'GLL_NUM'
    ,width   :100
    ,sortable:'true'
    ,editor :
     { type   :'numberbox'
      ,options:
      { required :true
      ,prompt   :'Land...'
      ,validType:'extLength[3]'
      }
      }
   }
....
The input field GLL_NUM should allow only 3 digits entry. How to manage?

Thanks
Jaimi


Title: Re: edatagrid maxlength of input
Post by: stworthy on October 30, 2014, 01:29:45 AM
You can set the 'min' and 'max' properties to limit the value to a certain range.
Code:
editor:{
type:'numberbox',
options:{
required:true,
min:100,
max:999
}
}


Title: Re: edatagrid maxlength of input
Post by: jaimi on October 30, 2014, 04:10:15 AM
how does this work for a textbox? My possible range is bezween '000' and '999'.
Within the database it is a char(3) field which holds a 3 digit code front filled with 0-digits.

thanks
Jaimi