EasyUI Forum
May 10, 2024, 07:43:22 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: update for isValid extension for EasyUI 1.7.x  (Read 3597 times)
2plus2
Jr. Member
**
Posts: 75


View Profile
« on: May 03, 2019, 06:16:24 PM »

Howdy...

With the update of our site from 1.3 to 1.7 we've had to update our custom extension, like the isValid for the Combobox. To belabor the point, we sometime deactivate drop down values and on the default load & set the available drop down options do not have a value for the value stored in the DB. So we need to check to see if the value exist, and if not reload the drop down options with the "missing" value and set that as selected (plus warn the user that they need to select a new value. This way we can show the user the previous value and give them something to work with.

With the update to 1.7, we need to change the find option slightly due to changes in the names of the css classes. This is what I came up with, and I would like a quick yes/no on my update - basically did I select the correct css name that will help us down the road.

Code:
 
    $.extend($.fn.combo.methods, {
        isValid: function (jq) {
            // 1.3
            //var input = $.data(jq[0], 'combo').combo.find('input.combo-text');
            //
            // 1.7
            var input = $.data(jq[0], 'combo').combo.find('input.textbox-text');
            return input.validatebox('isValid');
        }
    });

Updates / corrections to my changes are welcome.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: May 03, 2019, 06:34:21 PM »

In version 1.3.x, the combo extends from validatebox. In version 1.7.x, the combo extends from textbox and the textbox extends from validatebox. The 'isValid' has been defined in the textbox component so the 'isValid' method is removed from $.fn.combo.methods. If you want to override it, try this code instead.
Code:
isValid: function(jq){
return jq.textbox('textbox').validatebox('isValid');
},
Logged
2plus2
Jr. Member
**
Posts: 75


View Profile
« Reply #2 on: May 04, 2019, 12:08:39 PM »

Ok  - thanks!

I don't remember why we overrode the isValid method before, but we'll try the default option. And nice to know we have a fall back if needed.

Much appreciated as always.
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!