easyui-datagrid 列單擊事件


首先要注意的就是,先添加一個js方法,名字可以自定義,但是必須得與下面的option里面的onClickRow:后面的一致即可
    
<script type="text/javascript">
        function ClickRow(rowIndex, rowData) {
            //            alert('這是Name:' + rowData.Name + '這個是ID:' + rowData.ID);            
            if (rowData.ModuleModel == 'DDS3366L') {
                document.getElementById("Archives").src = "real-time/ArchivesForE_P.aspx?ModuleID=" + rowData.ID;
            }
        } 
    </script>
 
在table的option里頭加上OnClickRow方法
<table id="List" class="easyui-datagrid" title="字典類型列表" style="width: 310px; height: 800px;
            margin: 0 0 0 0; float: left;" data-options="rownumbers:true,fitColumns:true,pagination:true,pageSize:20,pagePosition:'top',onClickRow:ClickRow,striped:true,singleSelect:true,url:'dit_Itemlist.aspx?from=sel'">
            <thead>
                <tr>
                    <th data-options="field:'BookName',sortable:true,width:80,align:'center'">
                        名稱
                    </th>
                </tr>
            </thead>
        </table>





免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM