Mootools HtmlTable.Sort Problem

  • | is undefined

    Trying the below code you might have got an error “| is undefined”.

    var mytable = new HtmlTable($(‘tableid’));
    mytable.enableSort();

    This happens because the HtmlTable.Select conflicts with HtmlTable.Sort, ie. HtmlTable.Select overrides HtmlTable.Sort. So when you download mootools more deselect HtmlTable.Select

    HtmlTable.Sort not working when firebug closed

    Now you might have got things working, but if you try closing the firebug the table sort won’t work.
    To fix this:
    Open your “mootools-1.2.4.4-more.js” and search the below string and comment it.

    if(c.console&&console.log){try{console.log.apply(console,arguments);}catch(d){console.log(Array.slice(arguments));
    }}else{Log.logged.push(arguments);}return this;

    The string which you comment checks the existance of console which is not required. Now you will have a proper working HtmlTable.Sort

    Download

    You can mootools-more fixed file here


    September 2nd, 2010 | Anas | No Comments | Tags: , , ,

About The Author

Anas Abdul Latheef

An application developer, developing for WorldWideWeb and iOS; residing in Dubai. Currently putting lot of effort to develop an iOS Game.

Leave a Reply

* Name, Email, and Comment are Required