jQuery UI对话框缓慢 [英] JQuery UI Dialog slow
问题描述
我最近有点痛苦.我一直在使用JQuery对话框在Web应用程序中显示一些配置屏幕.没什么特别的.但是我有一些极端的情况,其中此配置表单将显示一些下拉列表... 11000个选项. [DOODES ROTTEN TOMATOES]
I've recently ran into a bit of a pain. I've been using the JQuery Dialog box to display some configuration screens in a web app. Nothing too special. However I have a couple edge cases where this config form will display a drop down of some... 11000 options. [DODGES ROTTEN TOMATOES]
不用说,它很慢.显示"JQuery对话框"最多可能需要9秒钟(初始化过程也很慢).
Needless to say, it's slow. It can take up to 9 seconds for the JQuery Dialog to show (and the init is slow as well).
第一个问题是:有没有一种方法可以加快对话框的速度?从表面上看,它每次打开时都会复制所有内容.如果有办法避免这种情况,那会有所帮助.
First question is: Is there a way to speed up the Dialog boxes? From what it seems, it copies all the content each time it opens. If there was a way to avoid that, it would help a bit.
第二个问题:是否还有其他的jQuery对话框在被要求显示大量数据时表现更好?
Second question: Are there any other jQuery Dialog boxes that perform better when being asked to display large amounts of data?
和往常一样,欢迎使用其他解决方案.某些自动完成的ajax可能不错,但是除非它至少需要几个初始字符,否则它可能仍然很慢.
And as always, other solutions are welcome. Some autocomplete ajax wouldn't be bad, but probably still be slow unless it required at least a couple initial characters.
推荐答案
设法提高了性能.我偏离了JQuery UI,创建了一个轻得多的版本.我没有将目标的内容复制到对话框中,而是围绕内容构造了对话框.
Managed to improve the performance a little bit. I strayed from the JQuery UI and created a much lighter version. Instead of copying the contents of my target into my dialog, I construct my dialog around the content.
在性能方面,对话框从大约10秒变为2秒.
Performance wise, the dialog went from about 10 seconds to 2.
这篇关于jQuery UI对话框缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!