Scroller breaks rowHeight
Scroller breaks rowHeight
WingedFox
Posts: 4Questions: 0Answers: 0
Hello,
When i explicitly define rowHeight
1) it does not block auto measure feature (which works incorrectly for me because of tooo complex page layout
2) when i set autoHeight to false Scroller dies with NaN
this happens because of
[code]
/* Initial size calculations */
if ( this.s.rowHeight != 'auto' )
{
this.s.rowHeight = false;
}
[/code]
Here is the fix
[code]
/* Initial size calculations */
if ( this.s.rowHeight && this.s.rowHeight != 'auto' )
{
this.s.autoHeight = false;
}
[/code]
When i explicitly define rowHeight
1) it does not block auto measure feature (which works incorrectly for me because of tooo complex page layout
2) when i set autoHeight to false Scroller dies with NaN
this happens because of
[code]
/* Initial size calculations */
if ( this.s.rowHeight != 'auto' )
{
this.s.rowHeight = false;
}
[/code]
Here is the fix
[code]
/* Initial size calculations */
if ( this.s.rowHeight && this.s.rowHeight != 'auto' )
{
this.s.autoHeight = false;
}
[/code]
This discussion has been closed.
Replies
Allan
With my patch i'm going to change constructor to make a check "if rowHeight is set and its value is not 'auto' then disable automatic height calculation" instead of "if rowHeight is not 'auto' then set it value to 'false'"
Here is the step by step explanation
1.
[code]
oScroller : {
rowHeight: "21"
}
[/code]
results in 18px auto calculated height, because "this.s.rowHeight" is not equal to "auto", it's set to "false" in constructor and later is automatically calculated
2.
[code]
oScroller : {
rowHeight: "21",
autoHeight: false
}
[/code]
results in broken calculations (NaNs) because of
a) "this.s.rowHeight" is not equal to "auto", it's set to "false" in constructor
b) fnMeasure does not call to this._fnCalcRowHeight(); because autoHeight is set to false
Allan
Thank you for the great tool!
Thanks again for picking this up!
Regards,
Allan