PDA

View Full Version : [CLOSED] Default Trigger on Enter when Focus is in TriggerField



michaeld
Sep 30, 2013, 2:15 AM
It seems to me a lot of people have requested this obvious requirement for TriggerField.


http://forums.ext.net/showthread.php?7717-Fire-triggerclick-with-index-default-trigger-when-Enter-is-pressed-in-a-TriggerField

http://forums.ext.net/showthread.php?9346-TriggerField-KeyPress-event

Daniil
Sep 30, 2013, 6:06 AM
Hi @michaeld,

Thank you. I think we will implement it.

michaeld
Sep 30, 2013, 12:06 PM
Glee! Thanks. Let me know.

michaeld
Oct 08, 2013, 12:57 AM
I haven't seen this item entered into your tracking system. Is it going to make 2.3?

Daniil
Oct 08, 2013, 7:28 AM
It got slated after v2.3. However, the delay with v2.3 allowed me to implement it right away. So, it will go to v2.3.

The new TriggerIndexOnEnter property has appeared. It is a zero-based index of a trigger to be "clicked" (the TriggerClick event fires) on Enter key by default if that trigger exists and visible. Defaults to -1, which means no one.

Example

<ext:TriggerField runat="server" TriggerIndexOnEnter="0">
<Listeners>
<TriggerClick Handler="alert(index);" />
</Listeners>
</ext:TriggerField>

Thank you again for the request!

logicspeak
Feb 06, 2014, 4:13 PM
Daniil,

This fix isn't working for me (and I have the latest daily build as of this morning)...

I'm adding the TriggerField to a custom class that inherits from Ext.Net.Toolbar (I'm using the BottomBar of a Panel as my Menu and I have a "search" box triggerfield as a global search function. So, when the custom toolbar is initialized, here is my code:



SearchTrigger = new TriggerField();
SearchTrigger.ID = "tfSearch";
SearchTrigger.Width = new System.Web.UI.WebControls.Unit(150, System.Web.UI.WebControls.UnitType.Pixel);
SearchTrigger.Listeners.TriggerClick.Handler = new JFunction(string.Concat("LogicSpeak.MenuToolbar.search(", SearchTrigger.ClientID, ");")).ToScript();
SearchTrigger.TriggerIndexOnEnter = 0;
FieldTrigger trigger = new FieldTrigger();
trigger.Icon = TriggerIcon.Search;
SearchTrigger.Triggers.Add(trigger);
this.Items.Add(SearchTrigger);


Clicking the FieldTrigger (Search Icon) manually works, but pressing the ENTER key in the field reloads the whole page (like everyone was talking about).

Thanks!
Jason

Daniil
Feb 07, 2014, 5:24 AM
Hi Jason,

Please follow:
http://forums.ext.net/showthread.php?22424&p=97337&viewfull=1#post97337

logicspeak
Feb 07, 2014, 5:25 PM
Awesome. That did it. Thanks!
Jason


Hi Jason,

Please follow:
http://forums.ext.net/showthread.php?22424&p=97337&viewfull=1#post97337