[ 3 posts ]

Dennis Chen

  • Username: accelerate
  • Joined: Wed Mar 03, 2010 12:03 pm
  • Posts: 26
  • Offline
  • Profile

Datatable Scroll issues

Post Posted: Mon Mar 21, 2011 4:52 pm
+0-
I am just beginning to play around with YUI3 and DataTable, so I've been following the examples, and I'm having a couple of issues when using DataTable in conjunction with the scrolling plugin.

I have set up an example here:
http://jsfiddle.net/accelerate/bJQP3/

The two issues:

1) When setting just a horizontal scrollbar, the header widths do not match the data widths. Am I setting something wrong here? The thing I'm trying for is a table of a set width, which may be narrower or wider than what the table normally would be without scrolling.

2) When using scroll with sort, whenever I do sort a column, the scrollbar disappears. Is this expected behavior?

Alberto Santini

YUI Contributor

  • Offline
  • Profile
Tags:

Re: Datatable Scroll issues

Post Posted: Tue Mar 22, 2011 12:12 am
+0-
Hello Dennis.

For #2 see "DataTable + DataSource + DataTableScroll --> error" topic:
viewtopic.php?f=92&t=6355

Regards,
IceBox

Andrew Johnson

  • Username: johnsonand
  • Joined: Tue Jun 14, 2011 12:14 pm
  • Posts: 4
  • Location: Saskatoon, SK, Canada
  • Offline
  • Profile

Re: Datatable Scroll issues

Post Posted: Tue Jun 14, 2011 12:34 pm
+0-
Hi Dennis,

Did you ever find a solution to #1? I'm having the same issue.

It only occurs on columns with sortable set to true on a table with a scrollable width set. The arrow image showing how things are sorted seems to be causing the extra-wide header. Explicitly setting the col width makes the header width correct until you click on it to sort the column.

e.g., in the following code the Col1 header widths are correct, the Col3 header is too wide, and the Col2 header is correct until you click on it (making the little sort arrow image visible).
Code:
var cols = [{key:"Col1"},
     {key:"Col2",width:"200px", sortable:true},
     {key:"Col3", sortable:true}],
     dt = new Y.DataTable.Base({
     columnset: cols,
     recordset: data
     });
dt.plug(Y.Plugin.DataTableSort);
dt.plug(Y.Plugin.DataTableScroll, {
                        width: "98%",
                        height: "80%"
                    });


Any ideas on how to fix this are gratefully accepted.
Cheers,
Andrew
  [ 3 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum