pythontwitter-bootstrap-3migrationtypeahead.jsdeform

Typeahead not working with Pyramid_deform and Bootstrap 3


I got the task of migrating a project to Bootstrap 3, Now we are using deform, and deform_Bootstrap(also we are using pyramid_deform)

At first I got TypeError: $(...).typeahead is not a function, Then I upgraded all the packages, i.e `QueryUI, and typeahead.js to the latest versions.

Now it does not give me an error, but its not working either(not Auto-Completing).

Here is my code:

class Consignment(colander.MappingSchema):
    agent = colander.SchemaNode(
        colander.String(),
        validator=agent_validator,
        widget=AutocompleteInputWidget(
            size=60,
            # style="width: 250px",
            min_length=3,
            values="/agents/list.json"
            ))

And then somewhere else There is the following

def render_form(context, request):
    schema = Consignment()
    if not context or context.__is_new__:
        c_form = Form(schema, buttons=('create consignment',))
    return c_form.render()

I am using the latest version of deform and I have included the Bootstrap 3 libraries.

Is this a bug in Deform? How can I get past this obstacle? Any help would be apreciated.


Solution

  • I found the problem... I had to manually import/include the typeahead.css and typeahead.js from the Deform library, I also had to include deform.js...

    Thanks @ChrisMcDonough for all your help... I really appreciate it.