Select2 drop down with Ajax to return subset of data?

24 views
Skip to first unread message

Jo G

unread,
Sep 11, 2016, 5:31:46 PM9/11/16
to substanced-users
Hi, I have a pyramid based application using substanced and deform. I am using a select2 drop down pre-populated with a list of items. The list is very long and takes forever to load. Looking at select2 I should be able to use an Ajax call to a pyramid view to return a subset of the data.
Deform uses an old version of select2 and I'm finding it hard to get it and substanced to play nicely together.
My approach would be:
Define a view that returns a subset of data
Create my own widget based on the select2 widget
Write a new template for the widget
Make the form use Ajax

Anybody done this or can help?

Is there any reason I couldn't use an updated version of select2 jquery?

Is there a better widget I could use? I need to display a text value and return an associated integer ID.

Thanks in advance.

Reply all
Reply to author
Forward
0 new messages