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

Batch Validation

1 Answer 162 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Uchiha
Top achievements
Rank 1
Uchiha asked on 03 May 2016, 12:37 PM

I want to change default validation string message to some meaning full message please, can some tell me how to do that.this is my sample code i have attached a sample screen shot as well.Thanks.

 

 <kendo:grid   height="300" class="grid_status" name="grid_#=smscId#"  dataBound="gridDataBound"   insert="insertingRecordStatus" edit="editingRecord" pageable="false"  sortable="true" scrollable="true" navigatable="true" editable="true" style="text-transform: uppercase" width="400">
      
       <kendo:grid-toolbar>
           <kendo:grid-toolbarItem name="create"  />
           <kendo:grid-toolbarItem name="save" />
           <kendo:grid-toolbarItem name="cancel"/>
           <kendo:grid-toolbarItem name="Newitem" template="<input type='button' class='k-button k-button-icontext' value=' Load All Status' onclick='LoadAllStatus()' />"/>
        <kendo:grid-toolbarItem name="Newitem" template="<input type='button' class='k-button k-button-icontext' value=' Refresh' onclick='refreshStatus()' />"/>
       </kendo:grid-toolbar>
      
       <kendo:grid-columns>                 
           <kendo:grid-column title="Description" field="smssStatusdesc">            
           </kendo:grid-column>
           <kendo:grid-column title="smscType" field="smscType" hidden="true"/>
           <kendo:grid-column title="code" field="smssStatus" hidden="true"/>
           <kendo:grid-column title="Applied" field="smssFlg">
            <kendo:grid-column-values value="${smssFlg}"/>
           </kendo:grid-column>
           <kendo:grid-column title="type" field="type" hidden="true"/>            
           </kendo:grid-columns>
       <kendo:dataSource  serverPaging="true"  change="gridSuccessEvent" error="gridFailureEvent" data="data" serverSorting="false"
serverFiltering="false" serverGrouping="true" >
<%-- <kendo:dataSource-schema data="data" total="total"></kendo:dataSource-schema> --%>
           <kendo:dataSource-transport>                
               <kendo:dataSource-transport-read url="${readUrlhasSMSSRead}" data="<%=data%>" dataType="json" type="POST" contentType="application/json"  />
               <kendo:dataSource-transport-update url="${updateUrlhasSMSSUpdate}" dataType="json" type="POST" contentType="application/json">
</kendo:dataSource-transport-update>
<kendo:dataSource-transport-create url="${createUrlhasSMSSCreate}" dataType="json" type="POST" contentType="application/json">
</kendo:dataSource-transport-create>
               
               <kendo:dataSource-transport-parameterMap>
                <script>
                function parameterMap(options, type) {

                return JSON.stringify(options);

}
                </script>
               </kendo:dataSource-transport-parameterMap>
               
           </kendo:dataSource-transport>
            <kendo:dataSource-schema errors="errors" data="data" total="total" >
               <kendo:dataSource-schema-model id="smssId">
                   <kendo:dataSource-schema-model-fields>
                   
                        <kendo:dataSource-schema-model-field name="smssStatusdesc" type="string">
                        <kendo:dataSource-schema-model-field-validation required="true" />                        
                       </kendo:dataSource-schema-model-field>
                       <kendo:dataSource-schema-model-field name="smssFlg" type="string" defaultValue="1">
                        <kendo:dataSource-schema-model-field-validation required="false" />
                       </kendo:dataSource-schema-model-field>
                       <kendo:dataSource-schema-model-field name="smssStatus" type="string" defaultValue="Y">
                        <kendo:dataSource-schema-model-field-validation required="false" />
                       </kendo:dataSource-schema-model-field>
                       <kendo:dataSource-schema-model-field name="smssSmscId" type="string" defaultValue="#=smscId#" >
                        <kendo:dataSource-schema-model-field-validation required="false" />
                       </kendo:dataSource-schema-model-field>
                   </kendo:dataSource-schema-model-fields>
               </kendo:dataSource-schema-model>
           </kendo:dataSource-schema> 
       </kendo:dataSource>
   </kendo:grid>

 

 

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 04 May 2016, 12:04 PM
Hello,

You can customize the validation messages in the schema configuration of the model:

..
schema: {
    model: {
        id: "ProductID",
        fields: {
            fakeDate: {
                type: "date",
                validation: {
                    date: {
                        message: "My Custom Message"
                    }
                }
            },
//...other field definitions
        }
    }
}

Check out the following example that illustrates the approach:



Regards,
Viktor Tachev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Uchiha
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or