1 頁 (共 1 頁)

CCS 5.1 jquery select onfocus list data

發表於 : 2013-08-19 15:07:17
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"]);
    }); 
});