CCS 5.1 jquery select onfocus list data

CodeCharge Studio 2.x, 3.x, 4.x, 5.x
回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

CCS 5.1 jquery select onfocus list data

文章 yehlu »

1.add script

代碼: 選擇全部

<script src="../js/jquery/dependentlistbox/ccs-focus-listbox.js" type="text/javascript"></script>
2.bind event

代碼: 選擇全部

        features["get_prod_sub"] = $('*:ccsControl(prodSearch, s_prod_sub_id)'); 
        features["get_prod_unit"] = $('*:ccsControl(prodSearch, s_prod_unit_id)');  
3.add function

代碼: 選擇全部

$('#prodSearchs_prod_sub_id').focus(function() {
    params["get_prod_sub"] = {
        serviceUrl: "../services/get_prod_sub.php",
        masterPath: "prodSearch, s_prod_sub_id"
    }  
    features["get_prod_sub"].ccsBind(function() {
        this.ccsFocusListbox(params["get_prod_sub"]);
    }); 
}); 

$('#prodSearchs_prod_unit_id').focus(function() {
    params["get_prod_unit"] = {
        serviceUrl: "../services/get_prod_unit.php",
        masterPath: "prodSearch, s_prod_unit_id"
    }  
    features["get_prod_unit"].ccsBind(function() {
        this.ccsFocusListbox(params["get_prod_unit"]);
    }); 
});
回覆文章

回到「CodeCharge Studio」