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

Re: [ydn-javascript] ContextMenu and row selection in DataTable

Expand Messages
  • Satyam
    See: http://developer.yahoo.com/yui/datatable/#rowselect http://developer.yahoo.com/yui/examples/datatable/dt_rowselect.html
    Message 1 of 3 , Mar 3 3:19 AM
    • 0 Attachment
      See:

      http://developer.yahoo.com/yui/datatable/#rowselect

      http://developer.yahoo.com/yui/examples/datatable/dt_rowselect.html

      http://developer.yahoo.com/yui/examples/datatable/dt_contextmenu.html


      ----- Original Message -----
      From: "little_bobes" <little_bobes@...>
      To: <ydn-javascript@yahoogroups.com>
      Sent: Monday, March 03, 2008 11:33 AM
      Subject: [ydn-javascript] ContextMenu and row selection in DataTable


      > Hello,
      >
      > I have a ContextMenu and a DataTable with a row selection.
      > When I click right button on the DataTable, I need to select row in
      > that DataTable before the ContextMenu is fired.
      >
      > Where and what should I do?
      >
      > Thanks a lot, Bob (YUI v2.5.0)
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      > --
      > No virus found in this incoming message.
      > Checked by AVG Free Edition.
      > Version: 7.5.516 / Virus Database: 269.21.3/1307 - Release Date:
      > 02/03/2008 15:59
      >
      >
    • little_bobes
      Thanks, but I know how to select a row and how to implement the ContextMenu, what I need is: how to select row in the DataTable before the ContextMenu is
      Message 2 of 3 , Mar 3 4:09 AM
      • 0 Attachment
        Thanks, but I know how to select a row and how to implement the
        ContextMenu, what I need is: how to select row in the DataTable before
        the ContextMenu is fired.
        Fortunately, I found the solution:

        my.onContextMenuBeforeShowEvent = function() {
        var elRow = this.contextEventTarget;
        elRow = my.DataTable.getTrEl(elRow);
        my.DataTable.unselectAllRows();
        my.DataTable.selectRow(elRow);
        };

        my.ContextMenu.beforeShowEvent.subscribe(my.onContextMenuBeforeShowEvent);

        Bob

        > See:
        >
        > http://developer.yahoo.com/yui/datatable/#rowselect
        > http://developer.yahoo.com/yui/examples/datatable/dt_rowselect.html
        > http://developer.yahoo.com/yui/examples/datatable/dt_contextmenu.html
        >
        >
        > > I have a ContextMenu and a DataTable with a row selection.
        > > When I click right button on the DataTable, I need to select row in
        > > that DataTable before the ContextMenu is fired.
        > >
        > > Where and what should I do?
        > >
      Your message has been successfully submitted and would be delivered to recipients shortly.