如何在 django postman 中使用 django ajax-selects 更改 DropDown 显示
我目前正在使用名为 django-postman 的应用程序,该应用程序利用 django-ajax-selects 在内部发送消息时提供用户名自动完成功能。 django-ajax-selects 中显示的视图相当简洁,但当我实际使用它时,下拉列表的视图相当粗糙。
我已附上屏幕截图。任何人都可以帮助我了解为什么我会得到这个基本的粗略观点。
从这里可以看出,建议的名称出现在最后。我还想知道是否可以添加用户头像及其姓名,以使其更具视觉吸引力。
I am currently using an application named django-postman
that makes use of django-ajax-selects
to provide autocomplete feature in user names when sending messages internally. The view shown in django-ajax-selects
is quite neat, but when I actually used it, the view of the dropdown
was prety crude.
I have attached a screenshot. Can anybody please help in knowing why am I getting this basic crude view.
As can be seen here the suggested name is coming right at the end. I also wanted to know if I can add the user gravatar, along with their name to make it more visually appealing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最终想出了如何解决这个问题,但没有更新这个答案。但既然我收到了评论,我想我应该分享我所知道的一切。我不完全记得我写了什么以便它开始正常工作,但我将分享我在文件中所做的所有设置,并希望它也适用于其他人
首先我安装了 django-ajax-selects自动完成字段。这是应用程序的链接 https://github.com/crucialfelix/django-ajax-selects< /a>
在项目中安装后,您需要在设置文件中进行这些特定设置
您需要在模板中包含 jquery 自动完成文件。现在该库已与 jquery ui 集成,因此请确保使用旧的 jquery 自动完成 js 文件。这可能是它不起作用的原因之一。
正如我所说,我不太记得我做了什么,以至于应用程序开始工作,但这些是我的项目中存在的所有设置。
谢谢
I eventually figured out how to solve this problem, but did not update this answer. But since I have received comments, I think I should share whatever I know. I don't exactly remember what did I do write so that it started working correctly, but I will share all the settings that I have made in my files, and hope it works for others as well
Firstly I installed django-ajax-selects for the autocomplete field. here is the link for the app https://github.com/crucialfelix/django-ajax-selects
After having installed in project you need these specific settings in the settings file
You need to include the jquery autocomplete file in your template. Now this library has been integrated with jquery ui so make sure that you use the old jquery autocomplete js file. This could potentially be one of the reasons for it not working.
As I said, I don't exactly remember what I did, such that the app started working but these are all the settings that exist in my project.
Thanks