bootstrap-ajax-typeahead icon indicating copy to clipboard operation
bootstrap-ajax-typeahead copied to clipboard

second typeahead not working

Open marccollin opened this issue 10 years ago • 0 comments

when i select a value from my second typeahead, i try to find the second one, like a master detail relation.

Actually my model typeahead never do the ajax call.

     var initModelTypeahead = function(brandId) {
        $("#model").typeahead({
            ajax: {
                url: '/brands/' + brandId + '/models',
                valueField: "modelId",
                displayField: "model"
            }
        });
    };

    $("#brand").typeahead({
        onSelect: function(item) {
            debugger;
            console.log(item);
            //enable component
            $("#model").removeAttr("disabled");
            initModelTypeahead(item.value);
        },
        ajax: {
            url: '/brands',
            valueField: "brandId",
            displayField: "brand"
        }
    });

marccollin avatar Jul 01 '15 01:07 marccollin