Clear Up
SharpKit Reference

Picker Class

Namespace: Ext.picker

Base Types

System.Object

Constructors

Name Description
Picker(PickerConfig)
Picker()

Properties

Name Description
alias A general picker class. {@link Ext.picker.Slot}s are used to organize multiple scrollable slots into a single picker. {@link #slots} is the only necessary configuration. The {@link #slots} configuration with a few key values: - **name:** The name of the slot (will be the key when using {@link #getValues} in this {@link Ext.picker.Picker}) - **title:** The title of this slot (if {@link #useTitles} is set to true) - **data/store:** The data or store to use for this slot. Remember, {@link Ext.picker.Slot} class extends from {@link Ext.dataview.DataView}. ## Examples @example preview var picker = Ext.create('Ext.Picker', { slots: [ { name : 'limit_speed', title: 'Speed', data : [ {text: '50 KB/s', value: 50}, {text: '100 KB/s', value: 100}, {text: '200 KB/s', value: 200}, {text: '300 KB/s', value: 300} ] } ] }); picker.show(); You can also customize the top toolbar on the {@link Ext.picker.Picker} by changing the {@link #doneButton} and {@link #cancelButton} configurations: @example preview var picker = Ext.create('Ext.Picker', { doneButton: 'I\'m done!', cancelButton: false, slots: [ { name : 'limit_speed', title: 'Speed', data : [ {text: '50 KB/s', value: 50}, {text: '100 KB/s', value: 100}, {text: '200 KB/s', value: 200}, {text: '300 KB/s', value: 300} ] } ] }); picker.show(); Or by passing a custom {@link #toolbar} configuration: @example preview var picker = Ext.create('Ext.Picker', { doneButton: false, cancelButton: false, toolbar: { ui: 'light', title: 'My Picker!' }, slots: [ { name : 'limit_speed', title: 'Speed', data : [ {text: '50 KB/s', value: 50}, {text: '100 KB/s', value: 100}, {text: '200 KB/s', value: 200}, {text: '300 KB/s', value: 300} ] } ] }); picker.show();
alternateClassName
extend A general picker class. {@link Ext.picker.Slot}s are used to organize multiple scrollable slots into a single picker. {@link #slots} is the only necessary configuration. The {@link #slots} configuration with a few key values: - **name:** The name of the slot (will be the key when using {@link #getValues} in this {@link Ext.picker.Picker}) - **title:** The title of this slot (if {@link #useTitles} is set to true) - **data/store:** The data or store to use for this slot. Remember, {@link Ext.picker.Slot} class extends from {@link Ext.dataview.DataView}. ## Examples @example preview var picker = Ext.create('Ext.Picker', { slots: [ { name : 'limit_speed', title: 'Speed', data : [ {text: '50 KB/s', value: 50}, {text: '100 KB/s', value: 100}, {text: '200 KB/s', value: 200}, {text: '300 KB/s', value: 300} ] } ] }); picker.show(); You can also customize the top toolbar on the {@link Ext.picker.Picker} by changing the {@link #doneButton} and {@link #cancelButton} configurations: @example preview var picker = Ext.create('Ext.Picker', { doneButton: 'I\'m done!', cancelButton: false, slots: [ { name : 'limit_speed', title: 'Speed', data : [ {text: '50 KB/s', value: 50}, {text: '100 KB/s', value: 100}, {text: '200 KB/s', value: 200}, {text: '300 KB/s', value: 300} ] } ] }); picker.show(); Or by passing a custom {@link #toolbar} configuration: @example preview var picker = Ext.create('Ext.Picker', { doneButton: false, cancelButton: false, toolbar: { ui: 'light', title: 'My Picker!' }, slots: [ { name : 'limit_speed', title: 'Speed', data : [ {text: '50 KB/s', value: 50}, {text: '100 KB/s', value: 100}, {text: '200 KB/s', value: 200}, {text: '300 KB/s', value: 300} ] } ] }); picker.show();
Value Returns the values of each of the pickers slots @return {Object} The values of the pickers slots
ValueAnimated
Values Returns the values of eaach of the pickers slots @return {Object} The values of the pickers slots

Methods

Name Description
applyCancelButton(object) Updates the {@link #cancelButton} configuration. Will change it into a button when appropriate, or just update the text if needed.
applyDoneButton(object) Updates the {@link #doneButton} configuration. Will change it into a button when appropriate, or just update the text if needed.
applySlots(object)
applyToolbar(object) @private
getValue() Returns the values of each of the pickers slots @return {Object} The values of the pickers slots
getValues() Returns the values of eaach of the pickers slots @return {Object} The values of the pickers slots
initElement()
onCancelButtonTap() @private Called when the cancel button has been tapped.
onDoneButtonTap() @private Called when the done button has been tapped.
onShow()
onSlotPick(object, object, object) @private Called when a slot has been picked.
setValue(object, bool) Sets the values of the pickers slots @param {Object} values The values in a {name:'value'} format @param {Boolean} animated True to animate setting the values @return {Ext.Picker} this This picker
setValueAnimated(object)
updateCancelButton(object, object)
updateDoneButton(object, object)
updateSlots(object, object) Adds any new {@link #slots} to this picker, and removes existing {@link #slots}
updateToolbar(object, object) @private
updateUseTitles(object) *
© Copyright 2005-2011 SharpKit. All rights reserved.