導航:首頁 > 編程語言 > extjsautoload滾動條

extjsautoload滾動條

發布時間:2024-01-05 13:41:42

A. extjs怎麼加上滾動條,而且要將分頁的一欄放在頁面的最下面,而不是緊接著數據的最後一條

你用了tbar就沒想到bbar?
dockedItems:[{
xtype:'pagingtoolbar',
store:'QueryFindPointStore',
dock:'bottom',
displayInfo:true,
displayMsg:'顯示 {0} - {1}條記錄,總共 {2}條記錄',
emptyMsg:'暫無數據'
}],
換成
bbar:{
xtype:'pagingtoolbar',
store:'QueryFindPointStore',
displayInfo:true,
displayMsg:'顯示 {0} - {1}條記錄,總共 {2}條記錄',
emptyMsg:'暫無數據'
},

B. Extjs 3.2版本 formpanel中同時出現橫、豎滾動條,用火狐和谷歌測試時橫向滾動條無法去掉,求指教!

formpanel里的代碼
去掉內autoScroll:true,
修改容bodystyle:'overflow:auto;overflow-x:hidden;overflow-y:auto;border:1px solid #99bbe8;'

C. Extjs(3.0)中grid的滾動條,兩個gridpanel,拉動其中一個gridpanel的滾動條,另外一個滾動條也會跟著聯動

Ext渲染到界面上都是解析成html代碼的,你用火狐firebug找到頁面中存放滾動條的回div,
var obj=Ext.get('div_id');
obj.on('scroll',functionName);//綁定答滾動事件

function functionName(){
//do something

}

D. extjs的panel組件怎麼使用

//html代碼
<div id="container">
</div>

//js代碼
var p = new Ext.Panel({
title: 'My Panel',//標題
collapsible:true,//右上角上的那個收縮按鈕,設為false則不顯示
renderTo: 'container',//這個panel顯示在html中id為container的層中
width:400,
height:200,
html: "<p>我是內容,我包含的html可以被執行!</p>"//panel主體中的內容,可以執行html代碼
});

因為panel組件的子類組件包括TabPanel,GridPanel,FormPanel,TreePanel組件,所以非常有必要介紹Panel組件的配置參數和相關的屬性、方法。

//配置參數(只列舉部分常用參數)
1.autoLoad:有效的url字元串,把那個url中的body中的數據載入顯示,但是可能沒有樣式和js控制,只是html數據
2.autoScroll:設為true則內容溢出的時候產生滾動條,默認為false
3.autoShow:設為true顯示設為"x-hidden"的元素,很有必要,默認為false

4.bbar:底部條,顯示在主體內,//代碼:bbar:[{text:'底部工具欄bottomToolbar'}],
5.tbar:頂部條,顯示在主體內,//代碼:tbar:[{text:'頂部工具欄topToolbar'}],
6.buttons:按鈕集合,自動添加到footer中(footer參數,顯示在主體外)//代碼:buttons:[{text:"按鈕位於footer"}]
7.buttonAlign:footer中按鈕的位置,枚舉值為:"left","right","center",默認為right

8.collapsible:設為true,顯示右上角的收縮按鈕,默認為false
9.draggable:true則可拖動,但需要你提供操作過程,默認為false

10.html:主體的內容
11.id:id值,通過id可以找到這個組件,建議一般加上這個id值
12.width:寬度
13.height:高度
13.title:標題

14.titleCollapse:設為true,則點擊標題欄的任何地方都能收縮,默認為false.

15.applyTo:(id)呈現在哪個html元素裡面
16.contentEl:(id)呈現哪個html元素裡面,把el內的內容呈現
17.renderTo:(id)呈現在哪個html元素裡面
//關於這三個參數的區別(個人認為:applyTo和RenderTo強調to到html元素中,contentEl則是html元素到ext組件中去):
英文如下(本人英語poor,不敢亂翻譯):
contentEl - This config option is used to take existing content and place it in the body of a new panel. It is not going to be the actual panel itself. (It will actually the innerHTML of the el and use it for the body). You should add either the x-hidden or the x-hide-display CSS class to prevent a brief flicker of the content before it is rendered to the panel.
applyTo - This config option allows you to use pre-defined markup to create an entire Panel. By entire, I mean you can include the header, tbar, body, footer, etc. These elements must be in the correct order/hierarchy. Any components which are not found and need to be created will be autogenerated.
renderTo - This config option allows you to render a Panel as its created. This would be the same as saying myPanel.render(ELEMENT_TO_RENDER_TO);
哪位大人幫忙翻譯下...
考慮到入門,方法事件會在以後的文章中以實例穿插。
1.可拖動的panel實例
下面我們做個可拖動panel例子來熟悉下panel這個最基本的組件.

//html代碼
..無..

//下面創建一個允許拖動的panel,但是拖動的結果不能保存
var p=new Ext.Panel({
title: 'Drag me',
x: 100,
y: 100,
renderTo: Ext.getBody(),//x,y,renderTo:Ext.getBody()初始化panel的位置
floating: true,//true
frame: true,//圓角邊框
width: 400,
height: 200,
draggable:true
}).show();//在這里也可以不show()
但是還不能拖到其他的地方,我們需要改寫draggable:

draggable: {
insertProxy: false,//拖動時不虛線顯示原始位置

onDrag : function(e){
var pel = this.proxy.getEl();
this.x = pel.getLeft(true);
this.y = pel.getTop(true);//獲取拖動時panel的坐標
},
endDrag :

function(e){
this.panel.setPosition(this.x, this.y);//移動到最終位置
}
}
實現了可保存的拖動

拖動的時候陰影還在原位置,我們再在draggable中的onDrag事件中添加代碼:

var s = this.panel.getEl().shadow;
if (s) {
s.realign(this.x, this.y, pel.getWidth(), pel.getHeight());
}
//shadow的realign方法的四個參數,改變shadow的位置大小屬性
最後這個可拖動的panel的代碼為:

var p=new Ext.Panel({
title: 'Drag me',
x: 100,
y: 100,
renderTo: Ext.getBody(),
floating: true,
frame: true,
width: 400,
height: 200,
draggable: {
insertProxy: false,
onDrag :

function(e){
var pel = this.proxy.getEl();
this.x = pel.getLeft(true);
this.y = pel.getTop(true);

var s = this.panel.getEl().shadow;
if (s) {
s.realign(this.x, this.y, pel.getWidth(), pel.getHeight());
}
},
endDrag : function(e){
this.panel.setPosition(this.x, this.y);
}
}
})
//效果圖片我就不貼出來了
2.帶頂部,底部,腳部工具欄的panel

var p=new Ext.Panel({
id:"panel1",
title:"標題",
collapsible:true,
renderTo:"container",
closable:true,
width:400,
height:300,
tbar:[{text:"按鈕1"},{text:"按鈕2"}], //頂部工具欄
bbar:[{text:"按鈕1"},{text:"按鈕2"}], //底部工具欄
html:"內容",
buttons:[{text:"按鈕1"},{text:"按鈕2"}] //footer部工具欄
});

我們已經在各種工具欄上添加了按鈕,但是卻沒有激發事件,下面我們來添加按鈕事件代碼:

tbar:[{text:"按鈕1",handler:function(){Ext.MessageBox.alert("我是按鈕1","我是通過按鈕1激發出來的彈出框!")}},{text:"按鈕2"}],
//改寫tbar,添加handler句柄,點擊頂部工具欄上按鈕1,彈出提示框,效果圖大家想像下,就不貼出來了
當然,一般情況下,我們只要一個工具欄,這里只是為了演示!
3.panel工具欄

//添加下面的代碼到panel配置參數中
tools:[{id:"save"},{id:"help"},{id:"up"},{id:"close",handler:function(){Ext.MessageBox.alert("工具欄按鈕","工具欄上的關閉按鈕時間被激發了")}}],
//id控制按鈕,handler控制相應的事件
//id的枚舉值為:
toggle (collapsable為true時的默認值)
close
minimize
maximize
restore
gear
pin
unpin
right
left
up
down
refresh
minus
plus
help
search
save
print

E. extjs Gridpanel 橫向滾動條後面錯位

建議你把scrollOffset:0, 此屬性去掉,默認就可以!

F. extjs dataview 怎麼加滾動條

設置width和height,然後把autoScroll設置成true應該就可以了

閱讀全文

與extjsautoload滾動條相關的資料

熱點內容
網路營銷論文怎麼寫 瀏覽:326
在編程語言中函數是什麼 瀏覽:516
開票軟體金稅盤裡面怎麼數據遷移 瀏覽:591
電腦存放圖片有什麼文件夾 瀏覽:260
appleid不對怎麼激活 瀏覽:574
省份表單代碼 瀏覽:194
js原型繼承運行機制 瀏覽:440
jstl判斷的參數 瀏覽:86
java一個線程如何訪問其他方法 瀏覽:64
數字按鍵手機密碼忘記了怎麼刷機 瀏覽:823
小米怎樣設置指紋解鎖密碼是多少 瀏覽:841
caxa圖形轉為pdf文件 瀏覽:718
文件放在哪裡才能用r打開 瀏覽:130
沒有數據集如何重現別人的實驗 瀏覽:10
編程培訓機構待遇如何 瀏覽:822
機械版2018cad內文件夾 瀏覽:688
編程貓導師訓練在哪裡找 瀏覽:88
編程到底如何學習 瀏覽:807
android查看藍牙版本 瀏覽:289
食品批發類工作招聘有哪些網站 瀏覽:125

友情鏈接