0

キーアップイベントにテキストフィールドがあるカスタムコンポーネントを作成しました。ストアをフィルタリングする必要がありますが、イベント生成時に変数を取得していませんが、オブジェクトの作成時にオブジェクトを取得しています。以下はコードです-:

WildCardWindow = Ext.extend(Ext.Window, {
                      width  : 300,
                      height : 265,
                      resizable:true,
                      closeAction:'hide',
                      title:'WildCard Selection Window',
                      autoScroll:true,
                      iconCls:'icon-wildcard',
                      bodyStyle:'background-color:#FFFFFF',
                      //@cfg{Array} data-The array of fields/items to show in the window
                      data: null,
                      store:null,
                      /**
                       * @property
                       * @type String
                       * The message displayed when mouse over on an uncommitted field
                       */
                      uncommittMsg : '<b>Warning!</b> This field has been newly added in               
                                      the form designer. ' + 'It <i>can</i> be used now,  
                                      but you should be sure to save the uncommitted 
                                      changes ' + 'in the open form designer window.',
                      defaultIconCls : '',
                      initComponent : function(){
                                     this.createStore(this.data);
                                     this.items = this.createDataView();
                                     WildCardWindow.superclass.initComponent.call(this);
                      },
                      createDataView: function(){
                                     this.dataView = new Ext.DataView({
                                                  store: this.store,
                                                  autoWidth:true,
                                                  tpl: this.createTpl(),
                                                  autoHeight:true,
                                                  singleSelect : true,
                                                  overClass:'icon-view-over',
                                                  selectedClass:'icon-view-selected',
                                                  itemSelector:'.icon-dataview-item',
                                                  style:'cursor:pointer'
                                      });
                                      this.textField = new Ext.form.TextField({
                                          fieldLabel: 'To',
                                          tabTip:'Start typing to filter by field name', 
                                          name: 'f_to',
                                          enableKeyEvents :true,
                                          listeners: {
                                              keyup: function () {                                    
                        this.store.filter('name',this.textField.getValue(),true,false);
                        //Here I am not getting this.store and this.textField ??? 
                                          }}
                                      });
                                      return [this.dataView,this.textField]
                        },
                        createStore: function(data){
                                 this.store = new Ext.data.JsonStore({
                                             data:data,
                                             autoDestroy:true,
                                             fields:[
                                                 {name: 'id'},
                                                 {name: 'name'},
                                                 {name: 'fieldclass'},
                                                 {name: 'type'},
                                                 {name: 'options'},
                                                 {name: 'isMultiMember',type:'boolean'},
                                                 {name: 'isUnCommitted',type:'boolean'}
                                             ]
                                  });
                                  return this.store;
                          },
                          listeners:{
                                close: function(){
                                         this.store.filter('name','',true,false);
                                }
                          }
})

textfield のキーアップで this.store と this.textfield を取得できませんか?? 提案または私が間違っている場所。すぐに返信してください

4

1 に答える 1