JQUERY
1. Event 2. Traversing 爬樹 2-1 JQuery - $.each如何做到continue, break 3. DOM manipulate 4. jquery.validate 4-1 檢查公司編號是否重覆 5. 子母視窗 5-1 進貨單明細 - 商品子視窗 5-2 進貨單明細 - 商品子視窗(2) 5-3 進貨單主檔 - 廠商資料 6. form 6-1 判斷 checkbox 是否選取,實現全選跟全部取消 7. 指令
按鈕
templates/ugm_stk_purchase.tpl
<!--廠商編號-->
<div class='col-sm-3'>
<div class='form-group'>
<label for='vendor' class='control-label'>廠商編號</label>
<div class="input-group">
<input type="text" class="form-control" id="vendor" name='vendor' value="<{$row.vendor}>" readonly>
<div class="input-group-prepend">
<a href="javascript:void(0)" class="vendorWin" >
<div class="input-group-text">...</div>
</a>
</div>
</div>
</div>
</div>
調用插件
//廠商視窗
$(".vendorWin").click(function(){
var sn = $('#vendor').val();//取得廠商流水號
var url = 'purchase.php?op=vendorWin&sn='+sn;
var wH = 350;
var wW = 600;
var position = $(this).offset();
var wL = position.left - wW - 300;
var wT = position.top; //
childWin(url,wH,wW,wL,wT);
});
子視窗函數
//子視窗函數
function childWin(url,wH,wW,wL,wT)
{
mywin=window.open("","","height=" + wH + ",width=" + wW + ",left="+ wL + ",top=" + wT );
mywin.location.href = url ;
}
程式流程
#----- 廠商視窗
case "vendorWin":
echo vendorWin($sn);
exit;
程式函數
傳回商品sn,由母視窗AJAX
程式
流程
函數