정보 보관 ver1.0

picker 사용법

James Wetzel 2013. 4. 23. 17:55

                        

xtype: "button", //버튼 생성

                        text: "지역 설정",

                        style: "position:absolute; top: 250px; left:10px; width: 70px; font-size:10px;", //버튼 스타일

                        handler: function () { //버튼 클릭 이벤트

                            if (!this.picker) {

                                this.picker = Ext.Viewport.add({

                                    xtype: "picker", //picker 생성

                                    doneButton: { text: "선택" }, //picker done 버튼 

                                    cancelButton: { text: "취소" }, //picker cancel 버튼

                                    slots: //picker Data

                                    [

                                        {

                                            name: "region",

                                            title: "지역 선택",

                                            data:

                                            [

                                                { text: "서울", value: 1 },

                                                { text: "대구", value: 2 }

                                            ]

                                        }

                                    ],

                                    listeners: { //picker 리스너

                                        "change": function (picker) { //picker done 버튼 이벤트

                                            Ext.Msg.alert(this.getValue().region.toString()); //picker 선택 값 출력

                                            //console.log(this.getValue().region);

                                        }

                                    }

                                });

                            }

                            this.picker.show();





728x90
반응형