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

Validation message: Want to use title property.

2 Answers 253 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Taiji
Top achievements
Rank 1
Taiji asked on 06 Feb 2012, 10:06 AM
I'm use Japanese.

Extend prototype, I use validation's messages, 
kendo.ui.Validator.prototype.options.messages = {
    required: "{0} /* here Japanese*/",
....
}

But  " {0}  " is columns 's  field property.  
I want to use columns 's  title property.

How can I do it?

2 Answers, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 06 Feb 2012, 10:28 AM
Hi Taiji,

In order to use custom validation messages in grid's editing functionality they should be declared in the model definition. For example:

var dataSource = new kendo.data.DataSource({
   //..
    schema: {
        model: {
            id: "ProductID",
            fields: {           
                ProductName: {
                    validation: {
                        required: { message: "Product Name is required" }
                    }
                }
            }
        }
    }
});

All the best,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Taiji
Top achievements
Rank 1
answered on 06 Feb 2012, 11:18 AM
Thank you, quick response.

I can do it.

 When max or min,  write like the code.

ProductPrice: {
                    validation: {
                        required: { message: "Product Price is required" },
                       max :{ value : 1000, message : "...." }
                    }
                }
Tags
Grid
Asked by
Taiji
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Taiji
Top achievements
Rank 1
Share this question
or