PDA

View Full Version : View with left vertical scrollbar



fostom
9 Jan 2012, 11:42 AM
Hi!

I have a view like this which give me a nice scrollbar on the regular right side:



Ext.define('Agresso.ResourcePlanner.view.ResourceListView', {
extend: 'Ext.view.View',
...
autoScroll: true,

initComponent: function () {
var template = new Ext.XTemplate(
'<tpl for=".">',
'<div class="resource-ct">',
'{[this.getResourceImage(values.ResourceImageDocId)]}',
'<div class="resourceName">{ResourceName}</div>',
'<div class="resourceLabel">Start: <span class="resourceTextValue">{[this.formatDate(values.StartDate)]}</span></div>',
'<div class="resourceLabel">End: <span class="resourceTextValue">{[this.formatDate(values.EndDate)]}</span></div>',
'<div class="resourceLabel">Time: <span class="resourceTextValue">{Time} hours</span></div>',
'</div>',
'</tpl>', {
......
}
);

Ext.apply(this, {
tpl: template
});

this.callParent(arguments);
}
});


...but I would like to have the vertical scrollbar on the left side. Anybody who know how to do that?

Tom

mitchellsimoens
9 Jan 2012, 12:59 PM
On the element that has the scrollbar, you can try setting the CSS direction:rtl; but I'm not sure what ramifications this will have or if it will work reliably.

fostom
9 Jan 2012, 11:44 PM
On the element that has the scrollbar, you can try setting the CSS direction:rtl; but I'm not sure what ramifications this will have or if it will work reliably.

Yeah, thanks, that'll do the trick. It kinda fixes the issue with this, but it is a problem that the height of the child have to be set to a fixed size..

<style type="text/css">
.parent{
height:300px;
width:200px;
overflow:auto;
direction:rtl;
}
.child{
height:500px;
width:100%;
direction:rtl;
}
</style
<div class="parent">
<div class="child"></div>
</div>