2013-02-18 2 views
0
난은 FormPanel

변경 서식 패널 제목 엽차 터치

안에 내 제목을 변경해야

여기에 내 코드

view.js 

    Ext.define('bluebutton.view.BlueButton.Loyalty', { 
    extend: 'Ext.Container', 
    xtype: 'loyaltycard', 
     requires: [ 

    'bluebutton.view.BlueButton.TransactionList', 
    'bluebutton.view.BlueButton.MemberPopUp', 
    'bluebutton.view.BlueButton.MemberDetail', 

     'bluebutton.view.BlueButton.CouponMain', 

    'bluebutton.store.BlueButton.MemberList', 
    'bluebutton.store.BlueButton.CouponList', 

    'Ext.ux.keypad.Keypad', 
    'Ext.Img', 
    'Ext.carousel.Carousel' 



    ], 
    config: { 
//  iconCls: 'add_black', 
//  title :'Loyalty Point', 
     styleHtmlContent: true, 
     cls: 'styledContent', 
//   
     layout: 'hbox', 
     border: 3, 
     ui: 'round', 

     defaults: { 
       margin : '10 10 10 10', 
       padding : 10 
      }, 

     items :[ 


      { 
       flex: 1, 

       xtype :'formpanel', 
       id:'loyaltyform', 
       items :[ 
        { 
         xtype: 'fieldset', 
         cls :'containerRadious' , 

         title: 'Welcome, new member ~<i><u>Kenny</u></i>', 
          defaults: { 
          labelWidth: '35%', 
          style: 'font-size:1.0em' 
         }, 
         items: [ 
          { 

           xtype: 'image', 
           src: 'resources/images/user3.png', 
           height: 100, 
           margin:20 

          }, 



          { 
           xtype: 'textfield', 
           name : 'Name', 
           label: 'Name', 
           value :'Kenny Chow', 
           readOnly: true 
          }, 
          { 
           xtype: 'textfield', 
           name : 'Age', 
           label: 'Age', 
           value :'20', 
           readOnly: true 
          }, 
          { 
           xtype: 'textfield', 
           name : 'Point', 
           label: 'Point Available', 
           value :'50', 
           id :'point', 
           readOnly: true 
          }, 
          { 
           xtype: 'textfield', 
           name : 'lastVisited', 
           label: 'Last Visited', 
           id :'lastVisited', 
           value :'27/12/2012 11:53 AM', 
           readOnly: true 
          }, 


          { 
           xtype:'button', 
           text: 'Scan', 
           width : '100%', 
           id: 'btnScan', 

          }, 




         ] 

        } 
       ] 

      }, 


      { 
       flex: 2, 
       xtype :'carousel', 
        cls :'containerRadious' , 

       items :[ 
        { 

         xtype :'keypad', 
          layout: { 
          type: 'hbox', 
           pack: 'center' 
         }, 
        }, 

        { 
         xtype:'couponlistcard' 


        } 


       ] 


      } 




     ], 


    } 

}); 

컨트롤러

 onbtnAddClick: function (e) { 
       var loyaltyform = Ext.getCmp('loyaltyform'); 
       var pointAvalaible = Ext.getCmp('point').getValue(); 
       var keyPadValue = Ext.getCmp('keypad_value').getValue(); 
       var consumerID = Ext.getCmp('keypad_value').getValue(); 
      Ext.getCmp('loyaltyform').setTitle('Changed Title');; 

} 

입니다하지만 난이 오류가 발생합니다.

**Uncaught TypeError: Object [object Object] has no method 'setTitle'** 

누구든지이 문제에 직면하고 있습니까? 제발 도와주세요

답변

0

오류가 발생하는 이유는 formpanel에 setTitle() 메서드가 없기 때문입니다. 제목을 변경하려면 fieldsetsetTitle() 메서드를 호출해야합니다.이 메서드는 formpanel 내에 있습니다. 그래서 당신이 ID를 FIELDSET이를 사용하여 제공 :

Ext.getCmp('yourFieldsetID').setTitle('Changed Title'); 

엽차 워드 프로세서 당신이 FIELDSET 도중 패널에 사용할 수있는 방법을 확인하십시오

http://docs.sencha.com/touch/2-1/#!/api/Ext.form.Panel

http://docs.sencha.com/touch/2-1/#!/api/Ext.form.FieldSet

행운을 빕니다!