$colacola.AbstractButtoncola.AbstractCheckboxcola.AbstractContainercola.AbstractDropdowncola.AbstractEditorcola.AbstractInputcola.AbstractItemGroupcola.AbstractListcola.AbstractMenuItemcola.AbstractSlotListcola.AjaxValidatorcola.AsyncValidatorcola.Avatarcola.Breadcrumbcola.Buttoncola.ButtonGroupcola.Calendarcola.CardBookcola.Carouselcola.CascadeBindcola.Checkboxcola.ControlMenuItemcola.Cornercola.CustomDropdowncola.CustomValidatorcola.DataTypecola.DatePickercola.DateTimePickercola.Dialogcola.Dividercola.Dropdowncola.DropdownMenuItemcola.Elementcola.EmailValidatorcola.Entitycola.EntityDataTypecola.EntityListcola.FieldSetcola.GroupBoxcola.HeaderMenuItemcola.IFramecola.Imagecola.Inputcola.ItemsViewcola.Labelcola.Layercola.LengthValidatorcola.Linkcola.ListViewcola.Menucola.MenuButtoncola.MenuItemcola.Modelcola.MultiSlotPickercola.NestedListcola.NestedListBindcola.NestedListNodecola.Nodecola.NumberValidatorcola.Panelcola.PointingLabelcola.Progresscola.Propertycola.Providercola.RadioButtoncola.RadioGroupcola.RangeSlotListcola.Ratingcola.RegExpValidatorcola.RenderableElementcola.RequiredValidatorcola.Revealcola.Ribboncola.Segmentcola.Selectcola.Sidebarcola.Slidercola.SlotListcola.SplitPanecola.Stackcola.Stepscola.Tabcola.TabButtoncola.Tablecola.TableColumncola.TableContentColumncola.TableDataColumncola.TableGroupColumncola.TableSelectColumncola.Tagcola.TimeLinecola.TitleBarcola.Togglecola.Treecola.TreeNodecola.TreeNodeBindcola.UrlValidatorcola.Validatorcola.Widgetcola.breadcrumb.Sectioncola.buttonGroup.Separatorcola.steps.Stepcola.tab.AbstractTabButtoncola.utilcola.util.KeyedArray

cola.RequiredValidator

必填项校验器

validateEmptyValue
boolean
truecola.RequiredValidator
是否校验空数据
message
string
cola.Validator
当校验不通过时默认使用的提示信息
messageType
any
errorcola.Validator
当校验不通过时默认使用的消息类型
消息类型有三种取值:
  • info - 提示。
  • warning - 警告。
  • error - 错误。
disabled
boolean
cola.Validator
是否禁用此校验器
validate(value)校验数据cola.Validator
Parameters:
  • valueany

    要校验的数据

Returns:json
如果校验通过,此方法不会返回任何内容。否则此方法会返回一个JSON对象,该JSON对象中包含以下两个属性:
此方法的返回值是一个JSON对象
  • message - 校验信息。
  • messageType - 校验信息的类型,即error、warning、info三种取值之一。