{
text: 'Berkas',
align: 'center',
cell: {
xtype: 'button',
dataIndex: 'file_kp_prodi_mhs',
text: 'View',
handler: function(button, e) {
window.open(file_kp_prodi_mhs);
},
}
}
Asked
Active
Viewed 72 times
0

scebotari66
- 3,395
- 2
- 27
- 34
-
Hello, check this https://stackoverflow.com/questions/6303964/javascript-open-a-given-url-in-a-new-tab-by-clicking-a-button – spstrademark Sep 11 '20 at 08:24
-
window.open(url, "_blank"); – Madhu Magar Sep 11 '20 at 08:24
-
@MadhuMagar 121/5000 I store url in database, its value is in index data. how to get to the link stored in the index data? – Shella Eldwina Sep 11 '20 at 08:32
-
@spstrademark i have tried, but still not call the link i stored in DataIndex – Shella Eldwina Sep 11 '20 at 08:33
-
@ShellaEldwina what is the structure of index data? – Madhu Magar Sep 11 '20 at 08:35
-
@MadhuMagar i stored the link in dataIndex – Shella Eldwina Sep 11 '20 at 08:37
-
@ShellaEldwina Can you show dataindex? I mean dataindex object structure. – Madhu Magar Sep 11 '20 at 08:40
-
@MadhuMagar {name: 'file_kp_prodi_mhs', type: 'string'}. in the database, the file_pk_prodi contains the link. I want the button when clicked, it opens the saved link address – Shella Eldwina Sep 11 '20 at 08:45
2 Answers
1
Try this(change out vg.no with what you want):
<div href="https://www.vg.no" onclick="openInNewTab('https://www.vg.no')">Something To Click On</div>
<script>
function openInNewTab(url) {
var win = window.open(url);
win.focus();
}
</script>

TikkaSamurai
- 38
- 6
0
You should get value from record like:
{
text: 'Berkas',
align: 'center',
cell: {
xtype: 'button',
dataIndex: 'file_kp_prodi_mhs',
text: 'View',
handler: function(button, e) {
window.open(e.record.get(button.dataIndex));
},
}
}

norbeq
- 2,923
- 1
- 16
- 20