PDA

View Full Version : Call Direct Event onChange after delay



odaysaed
Apr 30, 2017, 10:51 AM
Hi everyone,
There is a problem on [change event] for example if i use a textbox to filtr a grid panel like this:

<ext:TextField ID="txtSearch" runat="server" MarginSpec="0 0 0 20" FieldLabel="Filter" Width="200" LabelWidth="70">
<DirectEvents>
<Change OnEvent="SetFilter" Delay="1000" />
</DirectEvents>
</ext:TextField>

so there is a delay for 1 sec, it supposed to mean that i have one second before i finished my text
so if i write 'foo' as fast as possible the event will reconize txtsearch.text = 'foo' that is correct
but the event is also check that 3 times in code behind

[B]the question is:
i want to write a text then the event goes to code behind for just one time after the delay finished.
is there anyway to do that? maybe another event like onchange,beforechange etc..

thank you

fabricio.murta
May 01, 2017, 6:26 PM
Hello @odaysaed!

You described the Buffer (http://docs.ext.net/dd/dd1/class_ext_1_1_net_1_1_base_listener.html#a680e1c2a fc94619be494e5dce79b7371) setting but used the Delay (http://docs.ext.net/dd/dd1/class_ext_1_1_net_1_1_base_listener.html#ae67ff96d 25207b98f020f5ad74e817ca) one instead. ;)

Hope this helps!

odaysaed
May 02, 2017, 8:11 AM
Thank you.

That is exactly what i want.
and its very helpful for filtering the grids and autocomplete combo-box.

thanks again