Hi,
i just want to toggle the y scroll of my scroll container to the bottom.
This feature is necessary for a chat application I think. So I thought I
could get the max scroll value with scrollContainer.getItemBottom(cont)
But if I add some widgets direct before the line of code, I just get the
value of the maximum y scroll value before adding these widgets. What am
I doing wrong?
Regards Mustafa Sak
qx.Class.define("chat.Application",
{
extend : qx.application.Standalone,
members :
{
/**
* This method contains the initial application
code and gets called
* during startup of the application
*/
main : function()
{
var _this = this;
// Call super class
this.base(arguments);
var main = new
qx.ui.container.Composite(new qx.ui.layout.VBox());
this.getRoot().add(main);
scrollContainer = new
qx.ui.container.Scroll();
scrollContainer.set(
{
width: 300,
height: 300
});
main.add(scrollContainer);
var cont = new
qx.ui.container.Composite(new qx.ui.layout.VBox()).set({backgroundColor:
"green"});
scrollContainer.add(cont);
main.add(testBnt= new
qx.ui.form.Button("Test"));
testBnt.addListener("execute",
function(e)
{
for (i=0;i<100 ;i++ )
{
cont.add(_this.generateBox(i));
}
console.log(scrollContainer.getItemBottom(cont));
scrollContainer.scrollToY(scrollContainer.getItemBottom(cont));
});
},
generateBox : function(i)
{
var cont = new
qx.ui.container.Composite(new qx.ui.layout.VBox()).set(
{
backgroundColor: "white",
padding: 5
});
var chatVerlauf = new
qx.ui.basic.Label(i + ". <strong>AAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA</strong>").set(
{
backgroundColor: "white",
rich: true,
selectable : true
});
cont.add(chatVerlauf);
return cont;
}
}
});
------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel