extjs Javascript -通过单击按钮在新选项卡中打开URL

smdncfj3  于 2022-11-05  发布在  Java
关注(0)|答案(2)|浏览(181)
{
     text: 'Berkas',
     align: 'center',
     cell: {

         xtype: 'button',
         dataIndex: 'file_kp_prodi_mhs',
         text: 'View',
         handler: function(button, e) {
             window.open(file_kp_prodi_mhs);
         },

     }
 }
sz81bmfz

sz81bmfz1#

试试这个(把www.example.comvg.no换成你想要的):

<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>
nafvub8i

nafvub8i2#

您应该从如下记录中获取值:

{
     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));
         },
     }
 }

相关问题