PDA

View Full Version : Paging Toolbar - hiding buttons in Sencha



opendave
21 Jul 2014, 2:34 PM
After some digging and experimentation, I was able to successfully his the First, Last, and Refresh buttons of the paging toolbar by creating a controller action for Render with this code:
component.down('#first').hide();
component.down('#last').hide();
component.down('#refresh').hide();

What I cannot seem to figure out how to do is hide the pipe separator that shows up between the last and refresh buttons.

I know the paging toolbar has 13 associated items, and I figured I might be able to loop through those to find/hide the one I am looking for. Unfortunately, I have not been able to figure it out.

What would be the best way to get the details on those 13 items? Or how could I search for/find the separator (which is defined only as '-' in the pagingtoolbar source)?


Thanks,
Dave

skirtle
22 Jul 2014, 5:05 AM
The '-' is converted into an Ext.toolbar.Separator and can be queried just like any other component. See:

http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.toolbar.Toolbar

You could do something like this:


var refresh = component.child('#refresh');

refresh.previousSibling().hide();
refresh.hide();

opendave
22 Jul 2014, 7:11 AM
Thanks skirtle!That is indeed the bit I was forgetting. I have everything working as needed now.