2012-03-30 62 views
1

我有一個很長的表單,所以用戶需要向下滾動表單。當使用鼠標滾動時,表單會暫時向下滾動,但一旦釋放鼠標,表單將再次向上滾動。使用選項卡時它工作正常。 更新 - 我也試過iPhone & Android設備,同樣的問題仍然存在。Sencha觸摸表單面板,不滾動鼠標

這是我的形式面板:

Ext.define('MyApp.view.Register', { 
extend: 'Ext.form.Panel', 
xtype: 'registerpage', 
id: 'createPatientForm', 


config: { 
    title: 'Registration', 
    iconCls: 'star', 
    scroll: 'vertical', 
    pinHeaders: true, 
    styleHtmlContent: true, 
    autoScroll: true, 
    layout:{ 
     type: 'vbox' 
    }, 

    items: [{ 
     xtype: 'fieldset', 
     title: 'Registration', 
     align: 'center', 
     centered: true, 
     items: [{ 
      xtype: 'textfield', 
      label: 'First Name', 
      name: 'firstName' 
     }, 
     { 
      xtype: 'textfield', 
      label: 'Last Name', 
      name: 'lastName' 
     } 
        //many more items in the form......... 
       ] 

     }] 
    }] 
} 

});

+1

Sencha **觸摸**不應該被使用鼠標的設備... – 2012-03-30 17:02:03

+0

我想,因爲鼠標不起作用,當使用觸摸界面進行滾動時會出現同樣的問題。 – Gaurav 2012-03-30 17:29:31

+0

您可以創建一個JSFiddle嗎?這會讓其他人試圖調試這個問題變得更容易。如果您指定了您正在使用的ST2版本以及您正在測試的平臺,瀏覽器等,也可能會有所幫助。謝謝。 – Jay 2012-04-01 06:28:47

回答

0

Sencha Touch 1和2不支持正常的鼠標滾輪。您必須點擊並拖動所有設備。

更新

你不需要在配置autoScroll。因爲不需要,您還需要取出layout: 'vbox'。如果你做了這兩件事情,它應該只是工作。

+0

我試過在iPhone和Android設備上,同樣的問題仍然存在,表單不能滾動。 – Gaurav 2012-03-31 14:25:44

+0

我已更新我的帖子。 – rdougan 2012-04-05 21:47:50

+0

不幸的是,我也沒有工作 – Gaurav 2012-04-05 23:19:57

0

如果使用煎茶觸摸2刪除自動滾屏,改變滾動

scrollable: { 
    direction: 'vertical', 
    directionLock: true 
} 

煎茶觸摸2 API http://docs.sencha.com/touch/2-0/#!/api/Ext.Panel-cfg-scrollable

+0

正確,但Ext.form.Panel的默認情況下可滾動,所以他不應該這樣做。他只需要刪除'layout'配置。 – rdougan 2012-04-05 21:48:21

+0

對不起,但它仍然不起作用 - http://pastebin.com/aTS1y9bW – Gaurav 2012-04-05 22:21:47

+0

你可以看到實時預覽,它不起作用 - http://maalguru.in/touch/Raxa/src/registration/ – Gaurav 2012-04-05 23:19:35

0

試試這個

Ext.define('overrides.SizeMonitor', { 
 
\t override: 'Ext.util.SizeMonitor', 
 
\t constructor: function (config) { 
 
\t \t var namespace = Ext.util.sizemonitor; 
 
\t \t return new namespace.Scroll(config); 
 
\t } 
 
}); 
 

 
Ext.define('overrides.SizeMonitor', { 
 
\t override: 'Ext.util.PaintMonitor', 
 
\t constructor: function (config) { 
 
\t \t return new Ext.util.paintmonitor.CssAnimation(config); 
 
\t } 
 
});