PDA

View Full Version : enable/disable paging toolbar problem



sanraj
6 Mar 2009, 7:51 AM
Hi,
In my application at one place I open one window which contain paging toolbar to show images in dataview.
I want to disable this paging toolbar When I open another child window in that window.
I have created child window using following config...



constrain: true,
modal: true,
constrainHeader: true,
draggable: false,
stateful:false,
renderTo: mainWindow.body,


Currently I am using following to enable/disable toolbar



,
listeners:{
show:function(){

mainWindow.getBottomToolbar().disable();
},
close:function(){

mainWindow.getBottomToolbar().enable();
}
}


But when the pagingtoolbar enables all buttons gen enabled even thugh there is one
record for dataview.
So can anyone tell me how can I maintain state between enable/disable?

Thanks in adv...........

mjlecomte
6 Mar 2009, 8:02 AM
I suspect you'll need to handle that manually.

sanraj
10 Mar 2009, 3:25 AM
Can you tell me how can I do that?

mjlecomte
10 Mar 2009, 7:24 PM
I guess you'll need to check the items in the toolbar. Check which ones are enabled before you disable them and store to some reference. Then when you want to enable them, just iterate through that reference so you know which ones should be enabled.

mystix
11 Mar 2009, 12:27 AM
would it be easier if you simply masked the toolbar element?


toolbar.getEl().mask(); // to disable
toolbar.getEl().unmask(); // to enable

that way you won't have to remember the state of individual toolbar elements.

mjlecomte
11 Mar 2009, 4:09 AM
would it be easier if you simply masked the toolbar element?
Yeah, that should be much easier to go that route. :)

sanraj
11 Mar 2009, 11:34 PM
Thank you very much mystix.
This is what I am looking for. It worked for me.

sanraj
=D> =D>