Wednesday, April 2, 2008

ExtJS DatePicker patch for Firefox 3

ExtJS's DatePicker is broken in FF3 (for the time being up to RC1).

Here is a patch. This is for ExtJS 2.0.2.

ext-all-debug.js: after line 17999 insert the highlighted statement below:

el.className = "x-date-picker";
el.style.width = '10px';
el.innerHTML = m.join("");

ext-all.js is minified, so you have to search for "x-date-picker", then you'll see that the statement looks a bit different. Thus, we modify the patch also:
B.className="x-date-picker";B.style.width = '10px';B.innerHTML=C.join("");...

15 comments:

  1. Cool! Now it's works. Let's create a community over ExtJS 2.0.2 to fix problems :)

    ReplyDelete
  2. Very nice, thank you!

    ReplyDelete
  3. If you prefer not to modify Ext files, use this after loading Ext scripts:

    Ext.DatePicker.prototype.brokenOnRender = Ext.DatePicker.prototype.onRender;
    Ext.DatePicker.prototype.onRender = function(container, position){
    // this.update has to be called only after setting width
    var originalUpdate = this.update;
    this.update = Ext.emptyFn;

    this.brokenOnRender(container, position);

    this.el.dom.style.width = '10px';
    this.update = originalUpdate;
    this.update(this.value);
    }

    ReplyDelete
  4. Thanks for that blog entry!!
    It really helped!!

    ReplyDelete
  5. Thanx Thats really helpful

    ReplyDelete
  6. FYI:
    It also works for ExtJS 1.1.1.

    ReplyDelete
  7. Perfect! Fixed for ExtJS 1.1.1 using Ondrej's comment.

    ReplyDelete
  8. Great Job, Fixed for the latest and last free download (2.0.2?) Waves of good karma for you

    ReplyDelete
  9. Owsome. It fixed my problem. Thanks a lot.

    ReplyDelete
  10. what about in version 3.2.0?
    the solution is same or not?

    ReplyDelete
  11. It's not an issue with current versions.

    ReplyDelete