This is a migrated thread and some comments may be shown as answers.

Limiting Text length in Editor

1 Answer 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Reid
Top achievements
Rank 2
Reid asked on 10 Jun 2016, 04:20 PM

I have set the max text length in the underlying model and the grid does not enforce it.  I have tried the following and it does not work:

 

function onEdit(e) {
          debugger;
 
              if (e.model.isNew()) {
 
            e.container.find("input[Id='strSubFundCode']").attr('readonly', false);
            e.container.find("input[Id='strSubFundCode']").attr('disabled', false);
        } else {
            e.container.find("input[Id='strSubFundCode']").attr('readonly', true);
            e.container.find("input[Id='strSubFundCode']").attr('disabled', true);
            e.container.find("input[Id=strSubFundCode]").attr("maxlength", 7);
        }
 
 
    }

Any suggestions would be welcome.

 

Thanks

 

 

 

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 14 Jun 2016, 10:38 AM
Hello Reid,

Please make sure that the following selector is actually returning the desired input:

e.container.find("input[Id=strSubFundCode]")...

I have prepared a simple dojo, demonstrating the desired functionality:

http://dojo.telerik.com/EWUno

I hope this helps.

Regards,
Dimiter Topalov
Telerik
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Grid
Asked by
Reid
Top achievements
Rank 2
Answers by
Dimiter Topalov
Telerik team
Share this question
or