In Chapter 2, we had talked about DatePicker
, which shows the dates in the form of slots and allows us to pick a date. DatePicker
is a specialised version of the Picker
class. In this recipe, we will see how to make use of this class.
Make sure that you have set up your development environment by following the recipes outlined in Chapter 1.
Carry out the following steps:
Create and open a new file named
ch06_08.js
and paste the following code in it:Ext.setup({ onReady: function() { var picker = new Ext.Picker({ slots: [ { name : 'color', data : [ {text: 'Red', value: 'red'}, {text: 'Peach', value: 'peach'}, {text: 'Yellow', value: 'yellow'}, {text: 'White', value: 'white'} ] } ], listeners: { pick: function(picker, pickedObj, slot) { Ext.Msg.alert('Info', 'Value picked is: ' + pickedObj.color); } ...