1. 程式人生 > >easyui子視窗列值的獲取

easyui子視窗列值的獲取

這次遇到的是問題是easyui開啟的dialog子視窗怎麼獲取他的多個列值進行判斷。

從後臺接收到的多條列資料去決定另一條列資料的狀態。


頁面程式碼:

<th field="isleave" width="90" hidden = "true" >是否請假</th>
<th field="isjoined" width="30" hidden = "true" >簽到時間</th>
<th field="isconfirm" width="30" hidden = "true">是否確認參加</th>
<th data-options="field:'mainshow',width:40,align:'center',formatter:formatState">狀態</th>

<th data-options="field:'_operate',width:80,align:'center',formatter:formatOper">操作</th> 

js:

 function formatState(value, row, index) {
        $('#mustJoin').datagrid('selectRow',index);
        rows=$('#mustJoin').datagrid('getRows');//獲取所有列
        if(rows){
return row.isleave == '是' ? value = '請假'
: row.isconfirm == '是' ? value = "確認參加" : value = '未響應';
       
        }
}