选择列表的批处理/块模式更新 - 如何避免? [英] Batch/Block-Mode updates to Select Lists - How to avoid?
问题描述
我有这个Applet托管的Socket连接到我的服务器和
ONevent / function我正在检索所有这些可爱的行服务器和
将它们插入Select-List。 (选择
列表的屏幕外观在前5行增长,然后滚动条出现,如果有更多的b / b
)。到现在为止还挺好。 。 。
问题是我插入的所有行都没有显示在屏幕上
,直到我从我的函数返回;所以,如果它最终成为1000行
那么用户什么都看不见,直到他们*全部*处理:-(这是一个
IE6唯一的东西吗?它发生在版本7或其他浏览器上吗?这个
很恶心!
是否可以选择设置?
我是否必须破解/强制某种事件(具有相应的ON功能)
然后从我的函数返回并让后续函数给我回电
重复到eof?Yuck。
我想做的就是看看我的行增长并在
选择列表(或表)中增加它们出现了吗?这真的太难以问了吗?是否真的是我们所拥有的IBM3270仿真垃圾?
问候Richard Maher
PS。有趣的事情(或希望的一线!)是,当我循环直到
list.options.length = 0 {list.remove(list。 options [0])}我看到行
在我眼前消失了。(不可否认,当我设置list.size = 1它确实
没有立即生效,但我们正在某个地方正确? (我把它设置为1
''我在[0]重新插入一个标题行))
Hi,
I have this Applet-hosted Socket connection to my server and in an
ONevent/function I am retrieving all these lovely rows from the server and
inserting them into the Select-List. (The on screen appearance of the Select
List grows for the first 5 rows then the scroll bar appears if there''s
more). So far so good. . .
The problem is that none of the rows I''m inserting appear on the screen
until I have RETURNed from my function; so If it ended up being 1000 rows
then the user sees nothing until they''re *all* processed :-( Is this an
IE6-only thing? Does it happen with Version 7 or with other browsers? This
is disgusting!
Is there an option to set somewhere?
Do I have to hack/force some sort of event (with coresponding ONfunction)
and then RETURN from my function and have the ensuing function call me back
and repeat till eof? Yuck.
All I want to do is see my rows grow and counter increment in the
select-list (or table) as they appear; is that really too much to ask? Is
IBM3270 emulation crap really as far as we''ve got?
Regards Richard Maher
PS. The funny thing (or glimmer of hope!) is, when I loop till
list.options.length = 0 {list.remove(list.options[0])} I see the rows
disappear before my eyes. (Admittedly when i set the list.size = 1 it does
not take immediate effect but we''re getting somewhere right? (I set it to 1
''cos I re-insert a "header row" at [0]))
推荐答案
3月17日上午6:52,Richard Maher < maher ... @ hotspamnotmail.com>
写道:
On Mar 17, 6:52 am, "Richard Maher" <maher...@hotspamnotmail.com>
wrote:
问题是我没有插入任何行出现在屏幕上
,直到我从我的功能返回;所以,如果它最终成为1000行
那么用户什么都看不见,直到他们*全部*处理:-(这是一个
IE6唯一的东西吗?它发生在版本7或其他浏览器上吗?这个
很恶心!
The problem is that none of the rows I''m inserting appear on the screen
until I have RETURNed from my function; so If it ended up being 1000 rows
then the user sees nothing until they''re *all* processed :-( Is this an
IE6-only thing? Does it happen with Version 7 or with other browsers? This
is disgusting!
解决方法 -
function something(){
//在这里添加选项
if(someCondition)setTimeout(something,1)
}
或者如果你想要一点点快 -
函数的东西(){
for(var x = 0; someCondition; x ++){
// addOption
if(x = 20&& someCondition){setTimeout(东西,1);休息}
}
}
^^它会在每次更新后更新GUI 20个选项。
workaround-
function something(){
// add option here
if(someCondition)setTimeout(something,1)
}
or if you want a little fast-
function something(){
for(var x=0;someCondition;x++){
// addOption here
if(x=20 && someCondition){setTimeout(something,1);break}
}
}
^^ it will update the GUI after every 20 options.
if(someCondition)setTimeout(something,1)
if(someCondition)setTimeout(something,1)
看起来不管怎么说它周围都有: - (我想
fireEvent,无论FF版本是什么,可能是正确的事情,而不是吝啬一个setNoTimeout(),但它只是有点难过选项
可以按需删除,但只是没有插入:-(
谢谢你。
干杯理查德马赫
PS。没有人在那里尝试用桌子而不是
选择列表在那里?
< sc *** **********@gmail.com在留言中写道
news:11 ******************** @ l77g2000hsb。 googlegrou ps.com ...
Doesn''t look like there''s anyway around it does there :-( I suppose
fireEvent and whatever the FF version is is probably the correct thing to
do, rather fudge a setNoTimeout() but it''s just a bit sad that the Options
can be removed on demand but just not inserted :-(
Thanks anway.
Cheers Richard Maher
PS. There''s noone out there that''s tried this with a Table rather than a
Select List is there?
<sc*************@gmail.comwrote in message
news:11********************@l77g2000hsb.googlegrou ps.com...
3月17日上午6:52,Richard Maher < maher ... @ hotspamnotmail.com>
写道:
On Mar 17, 6:52 am, "Richard Maher" <maher...@hotspamnotmail.com>
wrote:
问题是我没有插入任何行出现在屏幕上
,直到我从我的功能返回;所以如果它最终是1000
The problem is that none of the rows I''m inserting appear on the screen
until I have RETURNed from my function; so If it ended up being 1000
rows
rows
然后用户什么也看不见,直到他们*全部*处理:-(这是一个
IE6唯一的东西?它是否发生在版本7或其他浏览器?
then the user sees nothing until they''re *all* processed :-( Is this an
IE6-only thing? Does it happen with Version 7 or with other browsers?
这个
This
很恶心!
is disgusting!
解决方法 -
函数(){
//在这里添加选项
如果(someCondition)setTimeout(东西,1)
}
或者如果你想要一点快 -
函数(){
for(var x = 0; someCondition; x ++){
// addOption here
if(x = 20&& someCondition){setTimeout(something,1); break}
}
}
^^它会在每20个选项后更新GUI。
workaround-
function something(){
// add option here
if(someCondition)setTimeout(something,1)
}
or if you want a little fast-
function something(){
for(var x=0;someCondition;x++){
// addOption here
if(x=20 && someCondition){setTimeout(something,1);break}
}
}
^^ it will update the GUI after every 20 options.
Richard Maheraécrit:
Richard Maher a écrit :
我有这个Applet托管的Socket连接到我的服务器和
ONevent / function我从服务器检索所有这些可爱的行和
将它们插入Select-List。 (选择
列表的屏幕外观在前5行增长,然后滚动条出现,如果有更多的b / b
)。到现在为止还挺好。 。 。
问题是我插入的所有行都没有显示在屏幕上
,直到我从我的函数返回;所以,如果它最终成为1000行
那么用户什么都看不见,直到他们*全部*处理:-(这是一个
IE6唯一的东西吗?它发生在版本7或其他浏览器上吗?这个
很恶心!
Hi,
I have this Applet-hosted Socket connection to my server and in an
ONevent/function I am retrieving all these lovely rows from the server and
inserting them into the Select-List. (The on screen appearance of the Select
List grows for the first 5 rows then the scroll bar appears if there''s
more). So far so good. . .
The problem is that none of the rows I''m inserting appear on the screen
until I have RETURNed from my function; so If it ended up being 1000 rows
then the user sees nothing until they''re *all* processed :-( Is this an
IE6-only thing? Does it happen with Version 7 or with other browsers? This
is disgusting!
IE非常非常懒惰桌子
(Firefox将在不到1秒或2秒内完成工作)
IE is very very lazy with tables
(Firefox will do the job in less than 1 or 2 seconds)
是否可以选择设置某个位置?
Is there an option to set somewhere?
设置什么?
你没有显示你的功能,
怎么说要设置或修改或者...
to set what ?
you didn''t show your function,
how to say what to set or to modify or ...
我是否必须破解/强制某种事件(使用相应的ON函数)
然后从我的函数中返回有接下来的功能给我打电话
并重复直到eof?Yuck。
Do I have to hack/force some sort of event (with coresponding ONfunction)
and then RETURN from my function and have the ensuing function call me back
and repeat till eof? Yuck.
或许,如果你想*看*你的桌子在增长,
你必须为该功能编码吗?不是吗?
>
mini示例:
< html>
< script type =" text / javascript">
//可爱的行数组
var R = [12,11,10,9,''c'',''d'',''e'', ''one'',''two'',''tree''];
函数insertMyRows(idx){
var T = document。 getElementById(''myTable'')。insertRow(idx + 1);
var D = document.createElement(''TD'');
D.innerHTML = R [idx];
T.appendChild(D);
}
函数feedTable(计时器){
var L = R.length;
var i = 0;
while(i< L){
setTimeout('''insertMyRows( ''+ i +'')'',计时器* i);
i ++;
}
}
< / script>
< form action =" javascript :feedTable(document.form [0] [0] .value)">
延迟看表增长:
< input onclick =" this.select();" value =" 200">
并按[Enter];
< / form>
< a href =" #" onclick =" feedTable(200); return false;"> grow table< / a>
< table id =" myTable">
< ; tr>< th>测试< / th>< / tr>
< / table>
< / html>
Probably, if you want *to see* your table growing,
you''ll have to code for that feature ? no ?
mini example :
<html>
<script type="text/javascript">
// array of "lovely rows"
var R = [12,11,10,9,''c'',''d'',''e'',''one'',''two'',''tree''];
function insertMyRows(idx) {
var T = document.getElementById(''myTable'').insertRow(idx+1 );
var D = document.createElement(''TD'');
D.innerHTML = R[idx];
T.appendChild(D);
}
function feedTable(timer) {
var L = R.length;
var i=0;
while(i<L) {
setTimeout(''insertMyRows(''+i+'')'',timer*i);
i++;
}
}
</script>
<form action="javascript:feedTable(document.form[0][0].value)">
Delay to see table growing :
<input onclick="this.select();" value="200">
and hit [Enter];
</form>
<a href="#" onclick="feedTable(200);return false;">grow table</a>
<table id="myTable">
<tr><th>tests</th></tr>
</table>
</html>
我想要做的就是看看我的行增长和计数器增量出现在
选择列表(或表格)中;这真的太难问了吗?是否真的是我们所拥有的IBM3270仿真垃圾?
问候Richard Maher
PS 。有趣的事情(或希望的一线!)是,当我循环直到
list.options.length = 0 {list.remove(list.options [0])}我看到行
在我眼前消失了。 (不可否认,当我设置list.size = 1它确实
没有立即生效但是我们正在某个地方?(我把它设置为1
''我在[0]重新插入一个标题行))
All I want to do is see my rows grow and counter increment in the
select-list (or table) as they appear; is that really too much to ask? Is
IBM3270 emulation crap really as far as we''ve got?
Regards Richard Maher
PS. The funny thing (or glimmer of hope!) is, when I loop till
list.options.length = 0 {list.remove(list.options[0])} I see the rows
disappear before my eyes. (Admittedly when i set the list.size = 1 it does
not take immediate effect but we''re getting somewhere right? (I set it to 1
''cos I re-insert a "header row" at [0]))
我们可以看到一个例子吗?
(我不会让自己成为我理解你所说的内容的一个例子。
你能准确吗:用哪个导航器
- -
Stephane Moriaux et son(moins)vieuxMacdéjàdépassé
Stephane Moriaux和他的(较少)旧Mac已经过时
can we see an example on line ?
(I''ll not make myself an example of what I understand you''re telling)
can you precise : with which navigator(s)
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
这篇关于选择列表的批处理/块模式更新 - 如何避免?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!