EasyUI Forum
September 13, 2025, 02:19:41 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: Get error when close dialog  (Read 10113 times)
y.bykov
Newbie
*
Posts: 49


View Profile
« on: July 01, 2016, 08:59:46 AM »

I catch error message when I close dialog with a form.
Quote
Uncaught TypeError: Cannot read property 'options' of undefined

_49e   @   VM24260:6435
(anonymous function)   @   VM24260:6555
m.extend.each   @   jquery-1.11.3.min.js:2
m.fn.m.each   @   jquery-1.11.3.min.js:2
$.fn.validatebox.methods.validate   @   VM24260:6554
$.fn.validatebox   @   VM24260:6529
(anonymous function)   @   VM24260:6384
Stack:

My dialog onClose handler:
Code:
onClose: function () {
            app.current_dialog = false;
            app.keypress.activate();

            $(this).find('FORM').form('clear');
            window.localOnFormLoad = undefined;

            $(this).dialog('destroy');
},

Help me, please.
« Last Edit: July 01, 2016, 12:45:40 PM by y.bykov » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: July 01, 2016, 10:49:28 PM »

Please try to use a jQuery 1.9.x or higher version.
Logged
y.bykov
Newbie
*
Posts: 49


View Profile
« Reply #2 on: July 02, 2016, 03:24:09 AM »

I use jquery 1.11.3.min.js like in Demo example.
Logged
y.bykov
Newbie
*
Posts: 49


View Profile
« Reply #3 on: July 02, 2016, 03:50:56 AM »

Maybe it is important. I don`t submit my form, I just take form values and send separate ajax post-request.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: July 02, 2016, 07:03:01 AM »

If you want to destroy the dialog, you don't need to call the form's 'clear' method.
Code:
onClose: function () {
            app.current_dialog = false;
            app.keypress.activate();

            //$(this).find('FORM').form('clear');
            window.localOnFormLoad = undefined;

            $(this).dialog('destroy');
},

If your issue continues, please try to download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4.5-patch.zip.
Logged
y.bykov
Newbie
*
Posts: 49


View Profile
« Reply #5 on: July 02, 2016, 07:59:53 AM »

Yes! It`s work!
Thank you!

This patch solve one more problem with artefact elements (for combobox) that appear after recreate few times form dialog.
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!