[Dojo-interest] Intermittent ScrollBox Issue

Devine, James james.devine at fmr.com
Tue Apr 28 10:12:42 EDT 2009


Thank you for your help.  I've updated my code to use dojo.style.

Could you please point me to more information on the grid's onComplete
style functions?  

I am new to Dojo and am not familiar with these.  The only onComplete
functions that I have been able to find pertain to the datastore.

Thank you.

-----Original Message-----
From: dojo-interest-bounces at mail.dojotoolkit.org
[mailto:dojo-interest-bounces at mail.dojotoolkit.org] On Behalf Of Jared
Jurkiewicz
Sent: Tuesday, April 28, 2009 9:35 AM
To: dojo-interest at mail.dojotoolkit.org
Subject: Re: [Dojo-interest] Intermittent ScrollBox Issue

I recommend using dojo.style() to modify style properties over direct
access.   Eg:

dojo.style(scrollBoxes[0], "overflowY", "hidden");

For generally more consistent behavior.

Also, since grid loads async, I would not be surprised if its simply
timing on when grid has constructed the scroll box.  You may want to
connect to the grid's onComplete style functions and listen to when
they get called before you attempt to access scroll boxes.

-- Jared



On Tue, Apr 28, 2009 at 8:22 AM, Devine, James <james.devine at fmr.com>
wrote:
> Hello,
> I am seeing an intermittent timing issue with DataGrid scrollboxes (I
am
> using Dojo 1.3).
>
> - The last 2 lines of my addOnLoad method look like this:
> initScrollBoxes();
> dojo.style(dojo.body(), "visibility", "visible");
>
> - initScrollBoxes configures scrollboxes for 2 stacked grids:
> function initScrollBoxes() {
>
>  scrollBoxes = [];
>
>  // Get an array of the main grid and total grid scrollboxes:
>  dojo.query(".dojoxGridScrollbox", this.domNode).forEach(
>    function(x) {
>      scrollBoxes.push(x);
>    }
>  );
>
>  // Connect the onscroll of the total grid to the scroll of the main
> grid:
>  dojo.connect(scrollBoxes[1], "onscroll", function() {
>    scrollBoxes[0].scrollLeft = scrollBoxes[1].scrollLeft;}
>  );
>
>  // Hide the main grid horizontal scroll bar:
>  scrollBoxes[0].style.overflowX="hidden";
>
>  // If the top table is vertical scrolling, hide the total grid
> vertical srollbar, but
>  // create a 16px border to take up the width of the top scrollbar:
>  if (!useAutoHeight()) {
>     scrollBoxes[1].style.overflowY="hidden";
>     scrollBoxes[1].style.borderRight="solid";
>     scrollBoxes[1].style.borderWidth="16px";
>     scrollBoxes[1].style.borderColor="#ededed";
>  }
> }
>
> About 10% of the time that the page loads, I get an error saying that:
> 'scrollBoxes.0.style' is null or not an object
>
> Please let me know what I am doing wrong or if there is a recommended
> way to solve this problem.
>
> Thanks in advance.
>
>
> _______________________________________________
> 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://mail.dojotoolkit.org/mailman/listinfo/dojo-interest




More information about the Dojo-interest mailing list