EasyUI Forum
May 20, 2024, 03:30:46 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: Unselect combobox throw error  (Read 7169 times)
arma
Full Member
***
Posts: 110


View Profile
« on: July 23, 2014, 02:52:33 AM »

Hi,

When i unselect a combo, it throws error "TypeError: Cannot read property 'length' of undefined".
For example i have a combo with value 1 selected and then i run in console $('#mycombo').combobox('unselect',1);

Is it a bug or i call the method in a wrong way?

Note: i have attached onChange event in the combobox.

Thanks
Logged
arma
Full Member
***
Posts: 110


View Profile
« Reply #1 on: July 23, 2014, 02:56:49 AM »

Ah oke i got it,

when method unselect called, it will trigger onchange which will return newVal parameter as undefined. Solved now.

Code:
onChange: function(newVal, oldVal) {
                if(newVal === undefined){
                    return false;
                }

               .....
Logged
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!