PDA

View Full Version : button in Div



myput
23 Sep 2011, 5:28 AM
Hey,

I have i Html text in a panel, with some Div.
I would like to put a button in a div for appears an overlay form.
How i can do?
cause i tested some things but nothing walk.

this is my code:


GK.views.InfoView = Ext.extend(Ext.Panel, {
fullscreen: true,
html: '<div id="InfoContainer">' +
'<div id="InfoContainerBox">' +
'<div id="InfoMainInfoBox"><h1>BlaBla</h1></div>' +
'<div class="whitespace"></div>' +
'<div class="mybuttontooverlay"> HERE MY BUTTON </div>' +
'</div>' +
'</div>',

And the code for my button View:


GK.views.ContactButton = new Ext.Panel({
id: 'ContactButton',
layout: {
type: 'vbox',
pack: 'center',
align: 'stretch'
},
defaults: {
xtype: 'button',
cls: 'ContactButton',
ui: 'round',
},
items: [{
text: 'Contact Form',
handler: function() {
if (!this.popup) {
this.popup = new Ext.Panel({
floating: true,
modal: true,
centered: true,
width: 300,
height: 200,
styleHtmlContent: true,
scroll: 'vertical',
dockedItems: [{
dock: 'top',
xtype: 'toolbar',
title: 'Contact Me'
}],
//items: [GK.views.ContactInsideForm]
});
}
this.popup.show('pop');
}
}]
});


Is it possible ???
Need help please :)

Champi
23 Sep 2011, 9:10 PM
It's possible, with the renderTo property. Bind your button in the afterrender event.
take a look at this thread for a quick example : http://www.sencha.com/forum/showthread.php?148265-Carousel-in-List-as-Item.