We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Struggling with the doc

I'm trying to do seemingly "basic" things,  but your doc and I are having problems :(

For example, I'm trying to define a column where the cells are supposed to be integer values in the range of -2 to +2.
What should editType be?  This piece of doc suggests using ej.Grid.EditingType.NumericTextBox, whereas the example on the same pages uses editType: "numericedit". numericedit actually comes with a spinner, so it happens to be what I needed - not the "NumericTextBox". But I wonder why your information is organised in such a chaotic way. Or perhaps I did not understand the principles of your doc and was looking at the false places anyway?

I would appreciate a guiding hand to avoid such confusion in the future :-)

1 Reply

PK Prasanna Kumar Viswanathan Syncfusion Team October 5, 2016 06:26 AM UTC

Hi Michael, 

Thanks for contacting Syncfusion support. 

We suspect that you are expecting validation for the particular column which supposed to be have integer values in the range -2 to 2. If you want validation before saving the record, define the validationRules property in the columns. 

In this sample we used range as jQuery validation method to achieve the requirement. 

Find the code example and sample: 

$(function () { 
                // the datasource "window.gridData" is referred from jsondata.min.js 
                allowPaging: true, 
                editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true }, 
                columns: [ 
                        { field: "Freight", headerText: 'Freight', textAlign: ej.TextAlign.Right, validationRules: { number: true, range: [-2, 2] }, width: 80 }, 

Refer to the Help document 

Note: The below validation script files are needed when editing is enabled with validation. 

1. jquery.validate.min.js 

2. jquery.validate.unobtrusive.min.js 

Prasanna Kumar N.S.V 

Live Chat Icon For mobile
Up arrow icon