Loading ...
Sorry, an error occurred while loading the content.

Column Move in DataTable messes up the calling scope.

Expand Messages
  • allanbjork
    Hi, After doing a column move in a datatable, clicks on cells in that table no longer work properly. Tracing it out in firebug, it appears that the calling
    Message 1 of 2 , Apr 30, 2008
    • 0 Attachment
      Hi,

      After doing a column move in a datatable, clicks on cells in that table
      no longer work properly. Tracing it out in firebug, it appears that
      the calling scope for the datatable is set to the "window" object after
      the column move.

      Source Forge bug report is here:

      http://sourceforge.net/tracker/index.php?
      func=detail&aid=1951765&group_id=165715&atid=836476

      Example code is here:

      http://www-personal.umich.edu/~allan/yui/wrongscope/dblclickTest.html

      --Allan
    • Satyam
      Actually, the issue is not the scope. this is fine, it points to the DataTable. You lose the scope in the callback to setTimeout. After all, that is the
      Message 2 of 2 , Apr 30, 2008
      • 0 Attachment
        Actually, the issue is not the scope. 'this' is fine, it points to the
        DataTable. You lose the scope in the callback to setTimeout. After all,
        that is the reason you made self equal to this. You should have used self
        inside the callback.

        The problem you find is with the getColumn() method, as reported in:

        https://sourceforge.net/tracker/?func=detail&atid=836476&aid=1924416&group_id=165715

        Notice that in both click and dblclick, you get the record fine, it is
        getColumn that has an error and returns null. And to get the record, you
        use this, no problem there.

        Please update your SourceForge report.

        Satyam



        ----- Original Message -----
        From: "allanbjork" <allan@...>
        To: <ydn-javascript@yahoogroups.com>
        Sent: Wednesday, April 30, 2008 5:36 PM
        Subject: [ydn-javascript] Column Move in DataTable messes up the calling
        scope.


        > Hi,
        >
        > After doing a column move in a datatable, clicks on cells in that table
        > no longer work properly. Tracing it out in firebug, it appears that
        > the calling scope for the datatable is set to the "window" object after
        > the column move.
        >
        > Source Forge bug report is here:
        >
        > http://sourceforge.net/tracker/index.php?
        > func=detail&aid=1951765&group_id=165715&atid=836476
        >
        > Example code is here:
        >
        > http://www-personal.umich.edu/~allan/yui/wrongscope/dblclickTest.html
        >
        > --Allan
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        > --
        > No virus found in this incoming message.
        > Checked by AVG.
        > Version: 7.5.524 / Virus Database: 269.23.6/1404 - Release Date:
        > 29/04/2008 18:27
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.