EasyUI Forum
September 14, 2025, 04:30:40 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: combo onChange & OnSelect events when form loads [Solved]  (Read 24199 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« on: February 27, 2015, 04:49:29 AM »

http://jsfiddle.net/hFsxP/87/

Please see the fiddle, if you manually select the combobox, then the onChange and onSelect events fire.

But if when the form is loaded and the combo value is changed & selected, the events do not fire.

How can I get the event to fire whenever the combobox changes, either by the user of when the form is loaded programmatically ?

Other than the form events, is there another event on the combobox that I can hook into when the value changes ?
« Last Edit: March 02, 2015, 04:41:32 PM by devnull » Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: February 27, 2015, 11:21:01 PM »

Please download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4.1-patch.zip
Logged
Opan Mustopah
Full Member
***
Posts: 164


Indonesia


View Profile Email
« Reply #2 on: February 28, 2015, 08:02:34 AM »

there is patch too for version 1.4.0 about this issue stworthy???

Logged

-- Bajak Otak --
*** Sorry for my bad english :3 ***
--JeasyUI version 1.4--
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: February 28, 2015, 09:45:45 AM »

The patch for 1.4 is available from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4-patch.zip
Logged
Opan Mustopah
Full Member
***
Posts: 164


Indonesia


View Profile Email
« Reply #4 on: February 28, 2015, 09:49:23 AM »

thanks stworthy
Logged

-- Bajak Otak --
*** Sorry for my bad english :3 ***
--JeasyUI version 1.4--
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #5 on: February 28, 2015, 04:44:53 PM »

Sorry for not realizing this earlier, but the original design where the event is NOT triggered is actually desirable in many situations, especially when the combobox is the key record selector for the form, in which case it will cause recursion if triggered during form load.

Would it be possible to make this event trigger switchable with a new property ?



Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #6 on: March 01, 2015, 08:32:07 AM »

it will cause recursion if triggered during form load.

Could you please provide an example to show how this issue occur.
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #7 on: March 01, 2015, 04:38:46 PM »

This is what I mean:

http://jsfiddle.net/hFsxP/89/

It is OK using the existing version, but I am not sure if it will cause recursion due to the new patch ?

Whereby when the combo is selected, it loads the form, which changes / selects the combo, which loads the form, which changes the combo etc etc etc..
Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #8 on: March 01, 2015, 08:43:12 PM »

The 'onChange' event fires only when the value is changed. When a combo item is selected, loading the form using the selected combo value does not trigger the 'onChange' event again. It does not lead to an infinite recursion.
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #9 on: March 02, 2015, 04:41:00 PM »

Great, thanks for clarifying that and for the fix.
Logged

-- Licensed User --
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!