禁用点击一些网格上的easyyui

Disable click on some grid on easyui

本文关键字:网格 easyyui      更新时间:2023-09-26

我用easyyui制作了这个crud表。所有的工作都很完美,除了一件事:禁用点击在某些网格。

如何禁用点击一些网格?我的目标很简单,所以用户可以在表上编辑一些网格。

以下是我的观点:

<table id="dg_pindah" title="Tabel Pemindahan Dana" class="easyui-datagrid" data-options="iconCls:'icon-table-1',maximizable:true,collapsible:true" style="width:auto;height:420px"
            url="kas_pindah/getdata_p"
            toolbar="#toolbar_pindah" pagination="true" remoteSort="false" remoteFilter="true" sortName="" pageSize="25" pageList="[25,50,100,150,200,250,500]" rownumbers="true" fitColumns="false" singleSelect="true" showFooter="false" enableFilter="false">
                <thead data-options="frozen:true">
                    <tr>
                        <th field="status" width="110" halign="center" align="center" sortable="true" data-options="styler:cellStyler
                            ">Status Transfer</th>
                    </tr>
                </thead>
                <thead>
                    <tr>
                        <th field="no_pindah" width="100" halign="center" align="center" sortable="true">No.Referensi</th>
                        <th field="dari_kas" width="70" halign="center" align="center" sortable="true">Dari Kas</th>
                        <th field="tujuan_kas" width="80" halign="center" align="center" sortable="true">Tujuan Kas</th>
                        <th field="tanggal" width="130" halign="center" align="center" sortable="true" formatter="tgl_indo">Tanggal</th>
                        <th field="uraian" width="300" halign="center" align="left" sortable="true">Uraian</th>
                        <th field="penerimaan" width="110" halign="center" align="right" sortable="true" formatter="rupiah">Jumlah</th>
                        <th field="nama_penerima" width="120" halign="center" sortable="true">Penerima</th>
                        <th field="pekerjaan" width="130" halign="center" sortable="true">Pekerjaan</th>
                        <th field="alamat" width="130" halign="center" sortable="true">Alamat</th>
                    </tr>
                </thead>
        </table>

添加CSS指针事件

<table id="dg_pindah" style:"pointer-events: none;"
.....
 </table>

在相应的id/类上使用pointer-events: none。请确保将其添加到正确的id/类中,否则它将禁用整个元素的指针事件