This is a migrated thread and some comments may be shown as answers.

Horizontal scrollbar is not working

5 Answers 316 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sourav
Top achievements
Rank 1
Sourav asked on 10 Oct 2011, 12:18 PM
Horizontal scrollbar is not working as I have more column than the width.

5 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 11 Oct 2011, 08:52 AM
Hello Sourav,

Yes, this behavior will be available in the official release of Kendo UI in mid November. In the meantime, you can implement it manually by subscribing to the scroll event of the Grid data area (div.k-grid-content) and scroll the header area (div.k-grid-header-wrap) by the same amount. Alternatively, add the following code in the Grid source:

_scrollable: function() {
    var that = this,
        header,
        table,
        options = that.options,
        height = that.wrapper.innerHeight(),
        scrollable = options.scrollable,
        scrollbar = kendo.support.scrollbar();
 
        // some removed code here
 
        that.content.height(height);
 
        // horizontal scrolling :
 
        var scrollables = header.find(">.k-grid-header-wrap");
 
        that.content.bind('scroll', function () {
            scrollables.scrollLeft(this.scrollLeft);
        });
    }
}


Best wishes,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Sourav
Top achievements
Rank 1
answered on 12 Oct 2011, 09:16 AM
I have append the above source code in the kendo.grid.js .If I remove some portion of the code and implement it then the scrollbar is appearing but the header background portion is empty .

I have implement in the following way:

_scrollable: function() {
            var that = this,
                header,
                table,
                options = that.options,
                height = that.wrapper.innerHeight(),
                scrollable = options.scrollable,
                scrollbar = kendo.support.scrollbar();
  
            if (scrollable) {
                header = that.wrapper.children().filter(".t-grid-header");
                 
               /*
                     remove this portion
               */
                 
                that.content.height(height);
  
                // horizontal scrolling :
  
                var scrollables = header.find(">.k-grid-header-wrap");
                that.content.bind('scroll', function () {
                    scrollables.scrollLeft(this.scrollLeft);
                });
            }
        },

So , it is look different. Is this the right way what I have done?
0
Dimo
Telerik team
answered on 12 Oct 2011, 09:33 AM
Hello Sourav,

Try using the attached JS file.

Regards,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Devin
Top achievements
Rank 1
answered on 25 Jan 2012, 02:58 PM
Hi not trying to sound too stupid, I'm very new to programming as a whole..

Q: Has this update been merged with the current release, if so how do we call the horizontal scrolling? 

0
Dimo
Telerik team
answered on 25 Jan 2012, 03:57 PM
Hi Devin,

Yes, the update is now part of the official source.

In order to have horizontal scrolling, you need to set widths to all columns and ensure that their sum is greater than the Grid width.

Greetings,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Sourav
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Sourav
Top achievements
Rank 1
Devin
Top achievements
Rank 1
Share this question
or