Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,
I have a control A that fill data in Color_Type table and a control B fill data in Colors table and this control B is autocomplete control.
How i can filter data in control B by control A.
and my code:
JavaScript
function changeList_Color() {
    // Isolate the appropriate list by using the value
    // of the currently selected option
    cboColorType = document.getElementById("cboColorType");
    cboColor = document.getElementById("cboColor");

    var typeID = cboColorType.options[cboColorType.selectedIndex].value;
    var list = com.vietaz.thietbivattu.admin.CProduct.getColorType(typeID);
    list = list.value.split("|||");
    list = new Array(list[1].split(','), list[0].split(','));
    // Next empty the slave list
    emptyList(cboColor);
    // Then assign the new list values
    fillList(cboColor, list, com.vietaz.thietbivattu.admin.CProduct.getStringColor().value);

    //function call autocomplete
    (function($) {
        $(function() {
            //$('#cboColor').autocomplete( "destroy" )
            $('#cboColor').selectToAutocomplete();
        });
    })(jQuery);
}

Hope all help
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900