1
我試圖在extJs 4中創建按鈕。但是由於添加了屬性href和hrefTarget它改變了它的形狀。我應該做些什麼來給我的Button提供鏈接,而沒有將我的按鈕作爲錨標籤? Actualy我想在按鈕點擊打開新的標籤頁..如何在不改變按鈕形狀的情況下給鏈接按鈕?
var startButton = Ext.create('Ext.Button', {
text:'Start',
id: 'startButton',
href : 'http://www.google.com',
hrefTarget: '_blank',
baseCls:'deviceAuthenticationButtonCls button-link',
handler : function() {
console.log(Ext.getCmp('startButton'));
console.log("Form ",form.getForm().getValues());
form.getForm().setValues([
{id:'First', value: "0006660767C7"},
{id:'Second', value: "00066607644D"}
]);
var data = form.getForm().getValues();
console.log("Data To Send :- ",data);
form.getForm().submit({
url: './mmaGlove/',
method:'POST',
params : {
deviceAuthenticationData: JSON.stringify(data)
},
success: function(){
window.location = "http://www.google.com";
},
failure : function(){
alert('Got Error..');
}
});
}
});