$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.util.KeyedArray

KeyedArray

KeyedArray的作用类似于一个有序的Map表,他可以以有序的方式管理一组键值对。

size
number
集合中的元素数
add添加一个键值对cola.util.KeyedArray
Parameters:
  • keystring

    键值

  • elementany

Returns:cola.util.KeyedArray
remove删除一个键值对cola.util.KeyedArray
Parameters:
  • keystring || number

    键值或序号(从0开始)

Returns:any
get返回一个值cola.util.KeyedArray
Parameters:
  • keystring || number

    键值或序号(从0开始)

Returns:any
getIndex根据键值返回其在集合中的序号(从0开始)cola.util.KeyedArray
Parameters:
  • keystring

    键值

Returns:number
clear清空集合cola.util.KeyedArray
Returns:cola.util.KeyedArray
elements返回包含所有值的数组cola.util.KeyedArray
Returns:any
each迭代所有键值对cola.util.KeyedArray
Parameters:
  • fnfunction

    此方法支持两个传入参数,第一个参数是当前迭代的值,第二个是当前迭代的键值。 如果我们在某此回调时返回了false,那么迭代过程会就此终止,类似于在循环体中使用了break。其他任何返回值或不定义返回值,迭代过程都将继续执行。

Returns:cola.util.KeyedArray