PDA

View Full Version : Dynamic Toolbar Shortening & Preventing Last Grid Row to be Scrolled To



Joyfulbob
4 Nov 2013, 6:33 AM
I'm using the Rolodex Phone List grid plugin. It works great however you can't scroll down to the last grid row if there's a scroll bar. If I remove the dynamically created toolbar it works; so I know the toolbar's height in interfering with the grid's so it cant' display that last row; any ideas?

my grid:

var grid = new Ext.grid.GridPanel({
store: store,
columns: [
{id:'USRNM',header: 'Person', width: 180, sortable: true, renderer: navyIt, dataIndex: 'USRNM'},
{header: 'Profile', width: 70, sortable: true, hidden: true, dataIndex: 'USRPF'},
{header: 'Ext.', width: 45, sortable: true, align: 'right', dataIndex: 'PHEXT'},
{header: 'AM', width: 40, sortable: true, dataIndex: 'ACTCD'},
{header: 'Email', width: 150, sortable: true, dataIndex: 'EADR',
renderer: function(data,cell,record,columnIndex) {
if (data !== "" ) {
return '<span style="text-decoration: underline;cursor: pointer;color: blue;"><a href="mailto:' + data + '">' + data + '</a></span>';
} else {
return '';
}
}
},
{header: 'Division', width: 70, sortable: true, align: 'center', dataIndex: 'DIVID' },
{header: 'Active', width: 50, sortable: true, align: 'center', hidden: true, renderer: activeIt, dataIndex: 'ACTIVE'}
],
stripeRows: true,
height: 475,
width: 520,
title: 'Phone List (from the User Master)',
plugins: [azfilter],
el: 'azfilter-example'
});

The plugin code:

...
addToolbar: function() {
if (this.AZfield) {
var items = [{
text: this.clearText,
pressed: true,
enableToggle: true,
toggleGroup: 'AZfilter',
toggleHandler: this.buttonToggleHandler,
scope: this
},
'-',
{
text: '#',
enableToggle: true,
toggleGroup: 'AZfilter',
toggleHandler: this.buttonToggleHandler,
scope: this
}];
for (var i=65; i<91; i++) {
items.push({
text: String.fromCharCode(i),
enableToggle: true,
toggleGroup: 'AZfilter',
toggleHandler: this.buttonToggleHandler,
scope: this
});
}
var tb = new Ext.Toolbar({
items: items,
autoScroll: true
});

this.grid.elements += ',tbar';
this.grid.add(tb);
this.grid.doLayout();
}
}
...

There's another name after Miro Sreckovic:

46685

slemmon
5 Nov 2013, 10:09 PM
While we don't support user extensions perhaps someone in the community will be able to help you. Though it ultimately may be best to reach out the author of the user extension directly.

Joyfulbob
6 Nov 2013, 6:04 AM
Thanks for your reply. I tried searching for the author/original post but couldn't find him/her/it.

I haven't created a toolbar dynamically so I'm not familiar with heights; for those who do I think it would be relatively easy to look and see why the toolbar's height overrides the grid's and causes it to not be able to scroll to the last entry.

I tried executing grid.doLayout() after it's rendered hoping it would correct it but that doesn't work.

Joyfulbob
13 Nov 2013, 9:18 AM
bump