-
14 Jul 2009 8:03 AM #1
ListView limit viewable rows
ListView limit viewable rows
How do you configure a listview to show only 3 rows at a time and show scroll bars for the rest?
-
14 Jul 2009 9:08 AM #2
Constrain its height.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
14 Jul 2009 9:53 AM #3
Height where
Height where
Hi Animal,
First off thanks for all the help.
I was rendering the Listview to a basic div with height/width specified which was not working. I've attached the html sample as a .txt file if you don't mind taking a look.
<div id="companiesListView" style="height:100px;width:550px;overflow:auto"></div>
//the list view definition
var listViewCompanies = new Ext.ListView({
store: storeCompanies,
width: 500,
height: 50,
autoHeight: false,
multiSelect: true,
columnResize: true,
columnSort: true,
hideHeaders: false,
emptyText: 'No Companies to display',
loadingText: 'loading...',
reserveScrollOffset: true,
columns: columnsCompanies
});
listViewCompanies.render("companiesListView",1);
//If I encapsulate the div inside another like this i get a scroll bar but I don't want the header to scroll, how do i do this the right way?
//This forces the height
<div id="dCompanies" style="width:520px;height:100px;overflow:auto">
<div id="companiesListView" style="">
</div>
</div>
-
14 Jul 2009 9:59 AM #4
Where you render it to sohuld not constrain it. It scrolls within itself.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
14 Jul 2009 11:06 AM #5
Height problem
Height problem
That's the issue it's not making any difference when i specify the height.
Do I need to use a panel in order to get this to work so that the header doesn't scroll?
-
14 Jul 2009 11:11 AM #6
NO. You specify a height on the ListView.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
14 Jul 2009 11:22 AM #7
ListView height
ListView height
I'm trying that and it's frustrating because it doesn't seem to work. No matter what i specify for height it always renders all the rows without a scroll....
var listViewCompanies = new Ext.ListView({
store: storeCompanies,
width: 500,
height: 20,
autoHeight: false,
multiSelect: true,
columnResize: true,
columnSort: true,
hideHeaders: false,
emptyText: 'No Companies to display',
loadingText: 'loading...',
reserveScrollOffset: false,
columns: columnsCompanies
});
listViewCompanies.render("dCompanies",1);
<div id="dCompanies" style="border-color:black;border-width:thin;border-style
olid;">
</div>
-
14 Jul 2009 11:30 AM #8
Well obviously you'll not want reserveScrollOffset: false
You want space for a scrollbar don't you?
Also, just until the next release, you will have to add the style rule
Code:.x-list-body { height: 100%; }Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
14 Jul 2009 11:56 AM #9
ListView style override
ListView style override
Animal, Thanks for the help so far.
When i set height:100% it still would not limit the number of rows but once i made it 60px now i get three rows and then a scroll.
<style type="text/css">
.x-list-body {
height: 60px;
}
How would i apply this on an individual listview without affecting all the other listviews on the page?
-
14 Jul 2009 11:58 AM #10
Using a selector with an ID?
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642


Reply With Quote