[Dojo-interest] Attach a div to Dojo DataGrid horizontal scroll

Kevin Craine craineum at gmail.com
Wed Jul 29 16:34:34 EDT 2009


Ok, I figured it out... if anyone is interested.  You need to extend _View
to include what you want to update.  The hardest part about this is getting
the div structure laid out so it works in IE and FF, just really duplicated
what was there for the datagrid header that was already being scrolled.
Here is the declare:


dojo.declare("custom.View", dojox.grid._View, {
    doscroll: function(inEvent) {
        this.inherited(arguments);
        var customHeader = dojo.byId('customGridHeader');
        if (customHeader) {
            customHeader.scrollLeft = this.scrollboxNode.scrollLeft;
        }
    },

    update: function(){
        this.inherited(arguments);
        var customHeader = dojo.byId('customGridHeader');
        if (customHeader) {
            customHeader.scrollLeft = this.scrollboxNode.scrollLeft;
        }
    }
});

Kevin

On Wed, Jul 29, 2009 at 11:08 AM, Nathan Toone <toonetown at dojotoolkit.org>wrote:

> I don't believe this is possible.  The header scrolls with the grid
> horizontally, because it is *part* of the grid.  There isn't really a hook
> for scrolling any arbitrary node with the grid.
>
> -Nathan
>
>
> On Jul 29, 2009, at 7:04 AM, Kevin Craine wrote:
>
>  I have a fixed width datagrid being built programatically, and am trying
>> to put a header over top of it that will scroll with it. I can't do it as
>> part of the grid as that destroys the fixed width of the cells.
>> I would like to be able to scroll the top div as the scrollbar for the
>> DataGrid scrolls. This seems how the header works already, so it should be
>> possible. I just can't figure out how to link/attach it.
>>
>>
>>
>> Thanks,
>>
>> Kevin
>>
>> _______________________________________________
>> FAQ: http://dojotoolkit.org/support/faq
>> Book: http://dojotoolkit.org/docs/book
>> Forums: http://dojotoolkit.org/forum
>> Dojo-interest at mail.dojotoolkit.org
>> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>>
>
>
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest at mail.dojotoolkit.org<http://dojotoolkit.org/forum%0ADojo-interest@mail.dojotoolkit.org>
> http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-interest/attachments/20090729/2f0c910a/attachment.htm 


More information about the Dojo-interest mailing list