digitick / yii-combobox

Yii extension : A jQuery combobox, based on autocomplete
http://www.yiiframework.com/extension/combobox/
6 stars 14 forks source link

Error on "destroy" (Uncaught TypeError: Cannot call method 'remove' of undefined) #1

Open ader1990 opened 12 years ago

ader1990 commented 12 years ago

The "destroy" function looks like this:

destroy: function() { this.input.remove(); // this.input doesn't exist this.button.remove(); this.element.show(); $.Widget.prototype.destroy.call(this); }

"this.input" doesn't exist.

This is the full error code, where the 'undefined' is "this.input": Uncaught TypeError: Cannot call method 'remove' of undefined $.widget.destroy b.Widget._createWidget jQuery.event.dispatchjquery.js:3256 jQuery.event.add.elemData.handle.eventHandlejquery.js:2875 jQuery.event.triggerjquery.js:3144 jQuery.fn.extend.triggerHandlerjquery.js:3786 b.cleanData a.cleanData jQuery.fn.extend.emptyjquery.js:5822 _cleanupjquery.fancybox-1.3.4.js:962 jQuery.extend.speed.opt.completejquery.js:8590 jQuery.fx.stepjquery.js:8760 tjquery.js:8660 jQuery.extend.tick

subtronic commented 11 years ago

have the same error, when use combobox in dialog modal window, any idei?

ader1990 commented 11 years ago

Hey! You can comment it out. I think that your problem is a little bit bigger: Can you give more details on what you intend to do ?

subtronic commented 11 years ago

I do form in modal window(dialog jui, zii.widgets.jui.CJuiDialog) with combobox extension. If i use form(with combobox) without dialog it's work fine, but if with dialog, it's drop error when i open dialog, close dialog and want open again, i mean:

  1. Open dialog
  2. Close dialog without saving(click on X)
  3. And want open again dialog witout refresh page, here i get error.
  4. Uncaught TypeError: Cannot call method 'remove' of undefined
    1. $.widget.destroy
    2. (anonymous function)
    3. jQuery.event.dispatchjquery.js:3058http://diplomn.ru/assets/31b8fac2/jquery.js
    4. elemData.handle.eventHandlejquery.js:2676http://diplomn.ru/assets/31b8fac2/jquery.js
    5. jQuery.event.triggerjquery.js:2941http://diplomn.ru/assets/31b8fac2/jquery.js
    6. jQuery.fn.extend.triggerHandlerjquery.js:3604http://diplomn.ru/assets/31b8fac2/jquery.js
    7. b.cleanData
    8. e.cleanData
    9. jQuery.fn.extend.emptyjquery.js:5846http://diplomn.ru/assets/31b8fac2/jquery.js
    10. (anonymous function)jquery.js:5904http://diplomn.ru/assets/31b8fac2/jquery.js
    11. jQuery.extend.accessjquery.js:814http://diplomn.ru/assets/31b8fac2/jquery.js
    12. jQuery.fn.extend.htmljquery.js:5868http://diplomn.ru/assets/31b8fac2/jquery.js
    13. jQuery.ajax.successview:60 http://diplomn.ru/course/view?c=1#
    14. firejquery.js:974 http://diplomn.ru/assets/31b8fac2/jquery.js
    15. self.fireWithjquery.js:1084http://diplomn.ru/assets/31b8fac2/jquery.js
    16. donejquery.js:7803 http://diplomn.ru/assets/31b8fac2/jquery.js
    17. callbackjquery.js:8518http://diplomn.ru/assets/31b8fac2/jquery.js http://diplomn.ru/assets/31b8fac2/jquery.js

If i refresh page, i can repeat action mentioned above. I can take u my source if u want. I really don't know what's wrong. Can u help me?

P.S. Sorry for my English, i just recently started to study.

2013/4/1 Adrian Vladu notifications@github.com

Hey! You can comment it out. I think that your problem is a little bit bigger: Can you give more details on what you intend to do ?

— Reply to this email directly or view it on GitHubhttps://github.com/digitick/yii-combobox/issues/1#issuecomment-15726902 .

Tri0L commented 11 years ago

rename "destroy" to "_destroy"