PDA

View Full Version : Ext.LinkButton A button class which renders an <a> element.



Animal
17 Sep 2009, 2:07 AM
/**
* @class Ext.LinkButton
* @extends Ext.Button
* A Button which encapsulates an &lt;a> element to enable navigation, or downloading of files.
* @constructor
* Creates a new LinkButton
*/
Ext.LinkButton = Ext.extend(Ext.Button, {
template: new Ext.Template(
'<table cellspacing="0" class="x-btn {3}"><tbody class="{1}">',
'<tr>',
'<td class="x-btn-tl"><i>&#160;</i></td>',
'<td class="x-btn-tc"></td>',
'<td class="x-btn-tr"><i>&#160;</i></td>',
'</tr>',
'<tr>',
'<td class="x-btn-ml"><i>&#160;</i></td>',
'<td class="x-btn-mc">',
'<em class="{2}" unselectable="on">',
'<a href="{4}" style="display:block" target="{5}" class="x-btn-text">{0}</a>',
'</em>',
'</td>',
'<td class="x-btn-mr"><i>&#160;</i></td>',
'</tr>',
'<tr>',
'<td class="x-btn-bl"><i>&#160;</i></td>',
'<td class="x-btn-bc"></td>',
'<td class="x-btn-br"><i>&#160;</i></td>',
'</tr>',
'</tbody></table>'
).compile(),

buttonSelector : 'a:first',

/**
* @cfg String href
* The URL to create a link for.
*/
/**
* @cfg String target
* The target for the &lt;a> element.
*/
/**
* @cfg Object
* A set of parameters which are always passed to the URL specified in the href
*/
baseParams: {},

// private
params: {},

getTemplateArgs: function() {
return Ext.Button.prototype.getTemplateArgs.apply(this).concat([this.getHref(), this.target]);
},

onClick : function(e){
if(e.button != 0){
return;
}
if(this.disabled){
this.stopEvent(e);
} else {
if (this.fireEvent("click", this, e) !== false) {
if(this.handler){
this.handler.call(this.scope || this, this, e);
}
}
}
},

// private
getHref: function() {
var result = this.href;
var p = Ext.urlEncode(Ext.apply(Ext.apply({}, this.baseParams), this.params));
if (p.length) {
result += ((this.href.indexOf('?') == -1) ? '?' : '&') + p;
}
return result;
},

/**
* Sets the href of the link dynamically according to the params passed, and any {@link #baseParams} configured.
* @param {Object} Parameters to use in the href URL.
*/
setParams: function(p) {
this.params = p;
this.el.child(this.buttonSelector, true).href = this.getHref();
}
});
Ext.reg('linkbutton', Ext.LinkButton);


CSS rules needed for a pixel-perfect look:



table.x-btn .x-btn-small td.x-btn-mc em a {
text-decoration: none;
display: block;
height: 12px;
padding-bottom: 2px;
padding-top: 2px;
}

body.ext-opera table.x-btn .x-btn-small td.x-btn-mc em a,
body.ext-chrome table.x-btn .x-btn-small td.x-btn-mc em a {
padding-top: 1px;
}

body.ext-chrome table.x-btn .x-btn-small td.x-btn-mc em a {
padding-bottom: 3px;
}

Eric24
29 Sep 2009, 9:42 PM
Very nice! I've been trying to adapt this approach for use as a menu item (so instead of a button, a menu item would trigger a file download), but I'm not having much luck. Could you point me in the right direction?

Animal
29 Sep 2009, 9:54 PM
Menu items contain a link anyway.

http://www.extjs.com/deploy/dev/docs/?class=Ext.menu.Item&member=href

loeppky
21 Oct 2009, 3:25 PM
I totally agree that this functionality should be in the distributed Ext. I would post this in Animal's thread documenting this request (http://www.extjs.com/forum/showthread.php?t=12288), but I don't have premium forum access. Until Ext provides an href config option for Ext.button, one can also do:



handler : function(button) {
// Ext doesn't enable buttons to be a plain link, which is what we want in this case.
// We could use window.open, but most pop-up blockers will block the window.
// There is no use in creating an anchor tag, because it doesn't expose a click method.
// @see http://www.extjs.com/forum/showthread.php?t=12288
button.el.insertHtml(
'beforeBegin',
'<form action="http://yoururl.com" target="_blank" method="get" style="display:none"></form>'
).submit();
}


This isn't an actual link though, so "Open link in new tab" is not an option.

smokeman
10 Nov 2009, 7:34 AM
I used this with 3.0.3, and used an xtype:'linkbutton', href:'arklegaudit.gov', target:'_new'
and my link button gets rendered, but with a link of http://tapestry/outside3/x-btn-small%20x-btn-icon-small-left

which is the internal url of my current app..., strange...

nevermind...if you use the code from this link:
http://www.extjs.com/forum/showthread.php?p=351253#post351253
it works like a charm....I thought the code looked a bit different in that post.

Condor
10 Nov 2009, 7:37 AM
The browser sees href:'arklegaudit.gov' as a local url, so it prepends the current url.

You want:

href:'http://arklegaudit.gov'

smokeman
10 Nov 2009, 8:11 AM
I'm using this for a menu on a homepage, so that some buttons can open a new tab, or another page on the site....
The problem I just ran into, is that by switching the standard <button></button> to an <a, when you mix types, it renders a mix of text with underlines, and standard buttons. If I wanted to make this class not do anything to onclick if handler is defined, what would I need to do? That way, I could use the xtype:linkbutton for all buttons, so they look the same, but act differently, based on their definition(if they have a handler, or not)

smokeman
10 Nov 2009, 8:12 AM
no, I said nevermind...the link I included has code that works properly...look at the link I got when using this code....it wasn't a valid url at all....in fact, I tried it with all different types of urls, and they all resulted in the same "x-btn-small%20x-btn-icon-small-left" string as the url.
we might want to change the first post, with the updated code?


The browser sees href:'arklegaudit.gov' as a local url, so it prepends the current url.

You want:

href:'http://arklegaudit.gov'

Animal
10 Nov 2009, 8:21 AM
nthey all resulted in the same "x-btn-small%20x-btn-icon-small-left" string as the url.

I am using that class. Nothing like that happens.

Below, I am hovering the mouse over the "Labels" button which is a link to the generation of a PDF for the current consignment:

http://i131.photobucket.com/albums/p286/TimeTrialAnimal/linkbutton.jpg

smokeman
10 Nov 2009, 8:21 AM
I'm using this for a menu on a homepage, so that some buttons can open a new tab, or another page on the site....
The problem I just ran into, is that by switching the standard <button></button> to an <a, when you mix types, it renders a mix of text with underlines, and standard buttons. If I wanted to make this class not do anything to onclick if handler is defined, what would I need to do? That way, I could use the xtype:linkbutton for all buttons, so they look the same, but act differently, based on their definition(if they have a handler, or not)

I used a workaround, but this functionality would be nice:

I assigned my buttons to a toolbar, and gave the toolbar a cls:'customtoolbar' definition,
then used this css:
.customtoolbar a{
text-decoration:none !important;
}

Animal
10 Nov 2009, 8:26 AM
I added the CSS rules I use here to the first post,.

smokeman
10 Nov 2009, 8:33 AM
I am using that class. Nothing like that happens.

Below, I am hovering the mouse over the "Labels" button which is a link to the generation of a PDF for the current consignment:



I compared the 2, and the only differences, are the template, and the onClick function....
something in there didn't like my config, which is just a standard toolbar in a tabpanel...
just FYI for the next person that comes along...

smokeman
10 Nov 2009, 8:34 AM
I added the CSS rules I use here to the first post,.

thanks animal!
great extension!!

abraxxa
19 Nov 2009, 3:03 AM
I've the same problem as smokeman regardless of whether I pass an absolute url or a relative to the href attr.

Animal
19 Nov 2009, 3:19 AM
If you have a problem. Show code, show screenshots, show the DOM structure, describe your problem. A one line post won't get you anything.

abraxxa
19 Nov 2009, 3:30 AM
This is a simplified version of my code showing the problem:


var tb_locations = new Ext.Toolbar({
items:[{
xtype:'linkbutton',
text:'add',
href:'/location/add''
}]
});

var panel_locations = new Ext.grid.GridPanel({
title:'Locations',
iconCls:'icon-location',
collapsible:false,
tbar:tb_locations,
renderTo:'main'
});

That's the generated html:


<a class="x-btn-text" target="" style="display: block;" href="x-btn-small x-btn-icon-small-left" id="ext-gen34">add</a>

I've already checked the return value of getHref which is correct.
I assume the template vars are shifted due to multiple classes.
This is with ExtJS 3.0.3.

Animal
19 Nov 2009, 4:02 AM
I just tried it. The latest code from post #1.

And after fixing the unterminated string literal that your code has, it works fine, and creates



<a class=" x-btn-text" target="" style="display: block;" href="/location/add" id="ext-gen29">add</a>

abraxxa
19 Nov 2009, 4:11 AM
That was a copy'n'paste error, my code works fine in firebug.
Did you use ExtJS 3.0.3 as well?
Setting iconCls doesn't work either for me (icon-add in my example below).

That's the generated dom when using a simple button:

<table style="width: auto;" id="ext-comp-1004" class="x-btn x-btn-text-icon" cellspacing="0"><tbody class="x-btn-small x-btn-icon-small-left"><tr><td class="x-btn-tl"><i>&nbsp;</i></td><td class="x-btn-tc"></td><td class="x-btn-tr"><i>&nbsp;</i></td></tr><tr><td class="x-btn-ml"><i>&nbsp;</i></td><td class="x-btn-mc"><em class="" unselectable="on"><button id="ext-gen34" class="x-btn-text icon-add" type="button">add</button></em></td><td class="x-btn-mr"><i>&nbsp;</i></td></tr><tr><td class="x-btn-bl"><i>&nbsp;</i></td><td class="x-btn-bc"></td><td class="x-btn-br"><i>&nbsp;</i></td></tr></tbody></table>

And that when i change xtype to linkbutton:


<table style="width: auto;" id="ext-comp-1004" class="x-btn x-btn-text-icon " cellspacing="0"><tbody class="button"><tr><td class="x-btn-tl"><i>&nbsp;</i></td><td class="x-btn-tc"></td><td class="x-btn-tr"><i>&nbsp;</i></td></tr><tr><td class="x-btn-ml"><i>&nbsp;</i></td><td class="x-btn-mc"><em class="icon-add" unselectable="on"><a id="ext-gen34" href="x-btn-small%20x-btn-icon-small-left" style="display: block;" target="" class="x-btn-text">add</a></em></td><td class="x-btn-mr"><i>&nbsp;</i></td></tr><tr><td class="x-btn-bl"><i>&nbsp;</i></td><td class="x-btn-bc"></td><td class="x-btn-br"><i>&nbsp;</i></td></tr></tbody></table>

Animal
19 Nov 2009, 4:58 AM
Must be a difference in the Array that getTemplateArgs returns - checkit.

IMNSHO, it should return an Object like FormLayout uses, not an Array. Indices can change, names don't.

abraxxa
19 Nov 2009, 5:34 AM
When i alert myself with the return value I get this on page load for the add button:


add,button,icon-add, x-btn-text-icon,x-btn-small x-btn-icon-small-left,,http://myserver/location/add,
Where can I find infos about what the order and content should be?

Animal
19 Nov 2009, 5:36 AM
Errm, by reading the code?

smokeman
23 Nov 2009, 7:55 AM
how would I get one of these buttons to fire, like referencing the hanlder of a normal button?
I'm trying to simulate a user click.
I have these buttons in a tabpanel.
I want to call the first button(actually I get the second button(since first is a spacer)), and call the handler on tabchange.
for regurlar buttons, I do this:

tabchange:function(tabp,tabspanel){
atab=tabp.getActiveTab();
btn=tabspanel.toolbars[0].items.items[1];
console.log(btn);
btnhandler=btn.handler;
btnhandler();
}

abraxxa
23 Nov 2009, 8:28 AM
If you want a handler use a normal button, this is just a button holding a normal link aka href.

Animal
23 Nov 2009, 8:38 AM
If you mean programatically trigger a click which causes the navigation of the <a> element to occur, then you need this:



Ext.override(Ext.Element, {
fireEvent: (function() {
var HTMLEvts = /^(scroll|resize|load|unload|abort|error)$/,
mouseEvts = /^(click|dblclick|mousedown|mouseup|mouseover|mouseout|contextmenu|mousenter|mouseleave)$/,
UIEvts = /^(focus|blur|select|change|reset|keypress|keydown|keyup)$/,
onPref = /^on/;

return Ext.isIE ? function(e) {
e = e.toLowerCase();
if (!onPref.test(e)) {
e = 'on' + e;
}
this.dom.fireEvent(e, document.createEventObject());
} : function(e) {
e = e.toLowerCase();
e.replace(onPref, '');
var evt;
if (mouseEvts.test(e)) {
var b = this.getBox(),
x = b.x + b.width / 2,
y = b.y + b.height / 2;
evt = document.createEvent("MouseEvents");
evt.initMouseEvent(e, true, true, window, (e=='dblclick')?2:1, x, y, x, y, false, false, false, false, 0, null);
} else if (UIEvts.test(e)) {
evt = document.createEvent("UIEvents");
evt.initUIEvent(e, true, true, window, 0);
} else if (HTMLEvts.test(e)) {
evt = document.createEvent("HTMLEvents");
evt.initEvent(e, true, true);
}
if (evt) {
this.dom.dispatchEvent(evt);
}
}
})()
});

smokeman
23 Nov 2009, 11:02 AM
thanks for the code,
but after searching, I saw where you posted saying what I'm wanting to do, only works in chrome...?

http://www.extjs.com/forum/showthread.php?t=62313

I tried putting your code in, and using btn.fireEvent('click');
and it's not firing.

Animal
24 Nov 2009, 10:41 AM
Read the code.

Button already has a fireEvent method fro Observable.

Read that override. Which class is it for?

abraxxa
24 Nov 2009, 10:42 AM
Errm, by reading the code?

According to the Ext.Button docs getTemplateArgs returns an array.

Printing it to the firebug console shows this, which is exactly what the docs describe plus the two new parameters href and target your code applies:

["add", "button", "icon-add", " x-btn-text-icon", "x-btn-small x-btn-icon-small-left", "", "http://nac2.mon.dsh.at:3000/location/add", undefined]

Is it possible that the parameters have changed between 3.0 and 3.0.3?
In the template of the linkbutton {0} to {5} is used where the href is {4} and the target is {5}.
But href is {6} and target {7} in the array getTemplateArgs returns.
Changing <tbody class="{1}"> to <tbody class="{4}"> makes space for the icon.
That applied to a menu, I guess it's irrelevant: <em class="{2}" to <em class="{5}"
That correctly sets the icon: <class="x-btn-text"> to class="x-btn-text {2}">

Now the button looks and behaves like it should.
Maybe you can figure out why your template is different and works for you.

Animal
27 Nov 2009, 12:12 AM
OK, the latest rev (26th Nov 2009) has changed the template args again!

I have a Feature Request out there to make the template args an object, and to use textual substitution tokens in the template.

But here's the version that will work with the latest code from SVN (which will hopefully be 3.1)



/**
* @class Ext.LinkButton
* @extends Ext.Button
* A Button which encapsulates an &lt;a> element to enable navigation, or downloading of files.
* @constructor
* Creates a new LinkButton
*/
Ext.LinkButton = Ext.extend(Ext.Button, {
template: new Ext.Template(
'<table id="{4}" cellspacing="0" class="x-btn {3}"><tbody class="{1}">',
'<tr><td class="x-btn-tl"><i>&#160;</i></td><td class="x-btn-tc"></td><td class="x-btn-tr"><i>&#160;</i></td></tr>',
'<tr><td class="x-btn-ml"><i>&#160;</i></td><td class="x-btn-mc"><em class="{2}" unselectable="on"><a href="{5}" style="display:block" target="{6}" class="x-btn-text">{0}</a></em></td><td class="x-btn-mr"><i>&#160;</i></td></tr>',
'<tr><td class="x-btn-bl"><i>&#160;</i></td><td class="x-btn-bc"></td><td class="x-btn-br"><i>&#160;</i></td></tr>',
'</tbody></table>').compile(),

buttonSelector : 'a:first',

/**
* @cfg String href
* The URL to create a link for.
*/
/**
* @cfg String target
* The target for the &lt;a> element.
*/
/**
* @cfg Object
* A set of parameters which are always passed to the URL specified in the href
*/
baseParams: {},

// private
params: {},

getTemplateArgs: function() {
return Ext.Button.prototype.getTemplateArgs.apply(this).concat([this.getHref(), this.target]);
},

onClick : function(e){
if(e.button != 0){
return;
}
if(this.disabled){
e.stopEvent();
} else {
if (this.fireEvent("click", this, e) !== false) {
if(this.handler){
this.handler.call(this.scope || this, this, e);
}
}
}
},

// private
getHref: function() {
var result = this.href;
var p = Ext.urlEncode(Ext.apply(Ext.apply({}, this.baseParams), this.params));
if (p.length) {
result += ((this.href.indexOf('?') == -1) ? '?' : '&') + p;
}
return result;
},

/**
* Sets the href of the link dynamically according to the params passed, and any {@link #baseParams} configured.
* @param {Object} Parameters to use in the href URL.
*/
setParams: function(p) {
this.params = p;
this.el.child(this.buttonSelector, true).href = this.getHref();
}
});
Ext.reg('linkbutton', Ext.LinkButton);

abraxxa
17 Dec 2009, 3:39 AM
Your new version seems to work with 3.1.0.
Thanks!

PLaYoNe
4 Mar 2010, 8:31 PM
Hi, Ext.LinkButton's code works on ext 2.3.0???

Animal
4 Mar 2010, 10:21 PM
No. I cannot understand why people would still be using Ext 2!

whodat
5 Mar 2010, 9:07 AM
No. I cannot understand why people would still be using Ext 2!

Some of us had no choice.. :DBecause my client didn't want to wait.

Matthias_WB
23 Mar 2010, 10:21 AM
Can anybody post a demo-link fpr this extension???
Does Ext.LinkButton work with ExtJs3.1.1?

Animal
25 Mar 2010, 12:23 AM
AFAIK, it works with 3.1.1

Why, do you find a bug with 3.1.1?

abraxxa
25 Mar 2010, 12:31 AM
It works for me with both 3.1.1 and 3.2.0 beta.

grEvenX
23 Apr 2010, 12:31 AM
+1 for having this in official ExtJS (http://www.extjs.com/forum/showthread.php?12288-OPEN-635-Ext.Button-config-option-href-foo&p=351253). I'm really puzzled why no one from the ExtJS development team will speak out on that feature request, it seems a pretty minor non-breaking feature that a lot of people want to have.
Animal's credits in this community should also be a good pointer to have the dev-team listen in on that request.

It seems like the template or templatevars has changed again in ExtJS 3.2 release, and I had to change the template in order to have it work properly. The template I use now is:


template: new Ext.Template(
'<table id="{4}" cellspacing="0" class="x-btn {3}"><tbody class="{1}">',
'<tr><td class="x-btn-tl"><i> </i></td><td class="x-btn-tc"></td><td class="x-btn-tr"><i> </i></td></tr>',
'<tr>',
'<td class="x-btn-ml"><i> </i></td>',
'<td class="x-btn-mc">',
'<em class="{2}" unselectable="on">',
'<a href="{5}" style="display:block" target="{6}" class="x-btn-text">{0}</a>',
'</em>',
'</td>',
'<td class="x-btn-mr"><i> </i></td>',
'</tr>',
'<tr><td class="x-btn-bl"><i> </i></td><td class="x-btn-bc"></td><td class="x-btn-br"><i> </i></td></tr>',
'</tbody></table>'
).compile(),

santoshsatav
2 Jun 2010, 10:42 PM
can any body tell me how to remove underscore line below text on button

Animal
2 Jun 2010, 11:32 PM
Post 1 gives you the CSS! Didn't you read it?

santoshsatav
3 Jun 2010, 12:59 AM
sorry cause i am not using css mentioned

senacle
17 Jun 2010, 12:33 AM
+1 000 000 000 000 for having this in official ExtJS !

Stju
17 Jun 2010, 9:36 PM
+1 Surely this is needed again and again...

abraxxa
14 Sep 2010, 7:49 AM
I'm also still waiting that the LinkButton or better the href attribute gets added to ExtJS.

clesquir
31 Mar 2011, 11:38 AM
When you set a width to the button, the a tag doesn't wrap all the button. So if you click out of the wrap tag, it doesn't do anything. Here is an improved version of the code and css.



Ext.ux.LinkButton = Ext.extend(Ext.Button, {

template: new Ext.Template(
'<table id="{4}" cellspacing="0" class="x-btn {3}"><tbody class="{1}">',
'<tr><td class="x-btn-tl"><i> </i></td><td class="x-btn-tc"></td><td class="x-btn-tr"><i> </i></td></tr>',
'<tr><td class="x-btn-ml"><i> </i></td><td class="x-btn-mc"><em class="{2}" unselectable="on">',
'<a href="{5}" target="{6}"><span class="x-btn-text">{0}</span></a>',
'</em></td><td class="x-btn-mr"><i> </i></td></tr>',
'<tr><td class="x-btn-bl"><i> </i></td><td class="x-btn-bc"></td><td class="x-btn-br"><i> </i></td></tr>',
'</tbody></table>').compile(),

buttonSelector : 'a:first > span',

/**
* @cfg String href
* The URL to create a link for.
*/
/**
* @cfg String target
* The target for the &lt;a> element.
*/
/**
* @cfg Object
* A set of parameters which are always passed to the URL specified in the href
*/
baseParams: {},

// private
params: {},

getTemplateArgs: function() {
return Ext.Button.prototype.getTemplateArgs.apply(this).concat([this.getHref(), this.target]);
},

onClick : function(e){
if(e.button != 0){
return;
}
if(this.disabled){
e.stopEvent();
} else {
if (this.fireEvent("click", this, e) !== false) {
if(this.handler){
this.handler.call(this.scope || this, this, e);
}
}
}
},

// private
getHref: function() {
var result = this.href;
var p = Ext.urlEncode(Ext.apply(Ext.apply({}, this.baseParams), this.params));
if (p.length) {
result += ((this.href.indexOf('?') == -1) ? '?' : '&') + p;
}
return result;
},

/**
* Sets the href of the link dynamically according to the params passed, and any {@link #baseParams} configured.
* @p {Object} Parameters to use in the href URL.
*/
setParams: function(p) {
this.params = p;
this.el.child(this.buttonSelector, true).parent().href = this.getHref();
}
});

Ext.reg('linkbutton', Ext.ux.LinkButton);


And here is the CSS


**/
table.x-btn .x-btn-small td.x-btn-mc em a span {
text-decoration: none;
color: #333333;
display: inline;
height: 12px;
padding-bottom: 2px;
padding-top: 2px;
}

table.x-btn .x-btn-small td.x-btn-mc em a {
display: block;
}


Hope it will be useful!

neofraktal
21 Apr 2011, 12:07 AM
Hi, do you know if this extension works with 3.3.1?

I try tu use it but the template is always displayed as button instead of a+span.

clesquir
21 Apr 2011, 6:03 AM
Hi, do you know if this extension works with 3.3.1?

I am currently using 3.1.1 .. but I tried it in examples/button of ext 3.3.1 and it is working with the following code:



var div_lb = Ext.getBody().createChild({tag: 'div'});
var link_button = new Ext.ux.LinkButton({
iconCls: 'add16',
text: 'LinkButton',
renderTo: div_lb,
href: 'http://google.ca/'
});


Maybe just adding "text-decoration: none;" to the "table.x-btn .x-btn-small td.x-btn-mc em a" css class would help as I already had a css rule removing the text-decoration.

abraxxa
21 Apr 2011, 8:02 AM
I'm using it with 3.3.1 without problems, why are you asking?

neofraktal
21 Apr 2011, 9:26 AM
It's all ok, I was not using the version of the first post.

Thanks

gr0uch0
22 Apr 2011, 4:45 PM
I'm cracking up faster than my daughters Chocolate Easter Egg here. Any help much appreciated

I've got the latest (1st page) of the linkbutton and am trying to implement it as a print button on a modal window. What seems to be happening is that the is that the href is the 'id' being appended to the original URL (in this case its "localhost/main/print-button") which is clearly invalid - can anyone spot the mistake that is ignoring my href value please

cheers

Andy
SAOR ALBA



var addEventCard = new Ext.Window({
title: ''
, id: 'eventCard'
,layout:'fit'
,modal:true
,closable:true
,resizable:false
,shadowOffset: 8
,closeAction:'close'
,frame:true
,width:350
,height:400
,margins:'5'
,padding:'2'
,items:[addEventCardForm]
,buttonAlign: 'left'
,buttons: [{
xtype:'linkbutton'
,href: 'http://localhost:8080/jasperserver/flow.html'
,target: '_blank'
,baseParams: {_flowid: 'viewReport', reportUnit: '/Reports/ARC/testReport', eventnum: eventnum, output: 'pdf'}
,id: 'print-button'
,text: 'Print'
,icon: imgDir+'print.png'
,cls: 'x-btn-text'
}]
})

andyjl
28 Jun 2011, 9:25 AM
Has anyone gotten this to work with ExtJS 4.0.2?

abraxxa
28 Jun 2011, 2:09 PM
The ExtJS 4 button finally has a href attribute so you don't need this any more.

phoenixjj
28 Jun 2011, 8:06 PM
Hi Andyjl,

the default button as href attribute, so you need not to use this custom class anymore. When you set href attribute in button config, it is rendered as link.

Regards,
Phoenix.

extdev22
6 Jul 2011, 4:25 AM
Thanks for the very useful extention, any chance to have an example of how to use it?

jtkeller7983
14 Jul 2011, 1:33 PM
I need functionality that will call DirectJNgine methods to download some files. I can't use a HREF there is no link to the file. It would be like I want to download some blob in a DB and I make DirectJNgine calls to get the blob (or bits), but how do I get these downloaded to the browser. I've seen some examples that put up hiddern frames and forms, but these all call some PHP to get the bytes. I need to call java methods via DirectJNgine. Anyone have ideas?

mfruizs2
18 Oct 2011, 1:02 AM
One Q: I have the server request on a "characters" chain on xls, then, i have it on memory and i need to download it. Could do it ?

thx 4 ur job!