2

enter code herevar text ='Fill' ; if(value != undefined && value !=''){ text = Ext.Date.format(value,'Y-m-d'); } return ' '+text+' '

this above code is link to a new page when clicking 'Fill' link . i need that 'Fill' link to be as a button. How do i define a button instead of a text as a link using extjs

user1773596
  • 21
  • 1
  • 2

2 Answers2

0

The code is simple with JavaScript:

var btnLink = new Ext.Button({
  text: 'Fill',
  handler: function(){
    //you can put here any controls
    window.open("http://your-link-here.com", "_self")
  }
});

This will act as href opening link on the same page, and if you want to open it on a new window you can try window.open(url) instead..

Zaur Guliyev
  • 4,254
  • 7
  • 28
  • 44
0

My implementation of LinkButton for ExtJS. It can be used as a link directly (set 'stopEvent' to false) or as a button (use subscription to 'click' event)

LinkButton for ExtJs

Pencroff
  • 1,009
  • 9
  • 13