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

DDProxy doesn't respond on first click with DataTable

Expand Messages
  • whiteboy6969ca
    DDProxy doesn t respond on first click with DataTable Hi, I m trying to drag and drop rows from a DataTable. The rowMousedownEvent is fired when I click on a
    Message 1 of 10 , Jul 3, 2008
      DDProxy doesn't respond on first click with DataTableHi, I'm trying to drag and drop rows from a DataTable. The rowMousedownEvent is fired when I click on a row, but the proxy isn't created. It's only created on the second click for any given row. Any ideas?Code:
      (function() { 
      	var Dom = YAHOO.util.Dom,
      	    Event = YAHOO.util.Event
      		
      	var myColumnDefs = [
      	            {key:"table",label:"Table",sortable:true},
      	            {key:"item",label:"Item",sortable:true},
      		];
      	
      	// Grab table data from existing markup
      	myDataSource = new YAHOO.util.DataSource(YAHOO.util.Dom.get("table1"));
      	myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
      	myDataSource.responseSchema = {
      		fields: [{key:"table"},{key:"item"},]
      	};
      	
      	// Instantiate datatable with parsed markup (applies Sam theme)
      	myDataTable = new YAHOO.widget.DataTable("workarea1", myColumnDefs, 
      		myDataSource, {
      			sortedBy:{key:"table",dir:"desc"},
      	        	selectionMode:"single"
      	});
      
      	// Execute drag-and-drop code on mousedown
      	myDataTable.subscribe("rowMousedownEvent", function(ev) {
             		var rowElement = myDataTable.getTrEl(Event.getTarget(ev));
              
              	// Create a proxy for showing the row being dragged
              	var ddRow = new YAHOO.util.DDProxy(rowElement.id);
      		
              	// Highlight row selected for dragging
      		ddRow.onMouseDown = function(ev) {
      			myDataTable.highlightRow(rowElement);
      		};
      		
      		ddRow.onMouseUp = function(ev) {
      			myDataTable.unhighlightRow(rowElement);
      		};
      
      	});
      	
      	var myLogReader = new YAHOO.widget.LogReader();
      })(); 
      
    • Dav Glass
      peterdarrow -- You are actually creating the DDProxy on the first click, you need to make it active too :) What you are forgetting is the handleMouseDown call
      Message 2 of 10 , Jul 3, 2008
        peterdarrow --

        You are actually creating the DDProxy on the first click, you need to make it active too :)

        What you are forgetting is the handleMouseDown call on the Proxy
        ddRow.handleMouseDown(ev.event);

        This example shows how to do that (around line 30):
        http://blog.davglass.com/files/yui/datatable4/

        Hope that helps :D
        Dav

        Dav Glass
        dav.glass@...
        blog.davglass.com



        + Windows: n. - The most successful computer virus, ever. +
        + A computer without a Microsoft operating system is like a dog
        without bricks tied to its head +
        + A Microsoft Certified Systems Engineer is to computing what a
        McDonalds Certified Food Specialist is to fine cuisine +


        ----- Original Message ----
        From: whiteboy6969ca <peterdarrow@...>
        To: ydn-javascript@yahoogroups.com
        Sent: Thursday, July 3, 2008 8:55:58 AM
        Subject: [ydn-javascript] DDProxy doesn't respond on first click with DataTable

        DDProxy doesn't respond on first click with DataTableHi, I'm trying to drag and drop rows from a DataTable. The rowMousedownEvent is fired when I click on a row, but the proxy isn't created. It's only created on the second click for any given row. Any ideas?Code:
        (function() { 
        var Dom = YAHOO.util.Dom,
        Event = YAHOO.util.Event

        var myColumnDefs = [
        {key:"table",label:"Table",sortable:true},
        {key:"item",label:"Item",sortable:true},
        ];

        // Grab table data from existing markup
        myDataSource = new YAHOO.util.DataSource(YAHOO.util.Dom.get("table1"));
        myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
        myDataSource.responseSchema = {
        fields: [{key:"table"},{key:"item"},]
        };

        // Instantiate datatable with parsed markup (applies Sam theme)
        myDataTable = new YAHOO.widget.DataTable("workarea1", myColumnDefs,
        myDataSource, {
        sortedBy:{key:"table",dir:"desc"},
        selectionMode:"single"
        });

        // Execute drag-and-drop code on mousedown
        myDataTable.subscribe("rowMousedownEvent", function(ev) {
        var rowElement = myDataTable.getTrEl(Event.getTarget(ev));

        // Create a proxy for showing the row being dragged
        var ddRow = new YAHOO.util.DDProxy(rowElement.id);

        // Highlight row selected for dragging
        ddRow.onMouseDown = function(ev) {
        myDataTable.highlightRow(rowElement);
        };

        ddRow.onMouseUp = function(ev) {
        myDataTable.unhighlightRow(rowElement);
        };

        });

        var myLogReader = new YAHOO.widget.LogReader();
        })();
      • whiteboy6969ca
        Thanks for the response Dav, I didn t want to bother you again with this via e-mail. The problem with using that command is that it still doesn t execute
        Message 3 of 10 , Jul 3, 2008
          Thanks for the response Dav, I didn't want to bother you again with
          this via e-mail. The problem with using that command is that it still
          doesn't execute onMouseDown on the first click, only on the second.
          Thus, when I click to drag, the row doesn't get highlighted like it
          want it (but does create the proxy). I've looked at Satyam's code for
          this at http://www.satyam.com.ar/yui/2.5.0/invoice.html and his works
          without that line, and click + drag + highlight works on the first
          click. I've scoured his code for hints, but I can't find what I'm
          missing. Any other ideas?

          Peter

          --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
          >
          > peterdarrow --
          >
          > You are actually creating the DDProxy on the first click, you need
          to make it active too :)
          >
          > What you are forgetting is the handleMouseDown call on the Proxy
          > ddRow.handleMouseDown(ev.event);
          >
          > This example shows how to do that (around line 30):
          > http://blog.davglass.com/files/yui/datatable4/
          >
          >
          > Hope that helps :D
          > Dav
          >
          > Dav Glass
          > dav.glass@...
          > blog.davglass.com
          >
          >
          >
          >
          > + Windows: n. - The most successful computer virus, ever. +
          > + A computer without a Microsoft operating system is like a dog
          > without bricks tied to its head +
          > + A Microsoft Certified Systems Engineer is to computing what a
          > McDonalds Certified Food Specialist is to fine cuisine +
          >
          >
          >
          > ----- Original Message ----
          > From: whiteboy6969ca <peterdarrow@...>
          > To: ydn-javascript@yahoogroups.com
          > Sent: Thursday, July 3, 2008 8:55:58 AM
          > Subject: [ydn-javascript] DDProxy doesn't respond on first click
          with DataTable
          >
          > DDProxy doesn't respond on first click with DataTable Hi, I'm
          trying to drag and drop rows from a DataTable. The
          > rowMousedownEvent is fired when I click on a row, but the proxy isn't
          > created. It's only created on the second click for any given row. Any
          > ideas? Code:
          > (function() {
          > var Dom = YAHOO.util.Dom,
          > Event = YAHOO.util.Event
          >
          > var myColumnDefs = [
          > {key:"table",label:"Table",sortable:true},
          > {key:"item",label:"Item",sortable:true},
          > ];
          >
          > // Grab table data from existing markup
          > myDataSource = new YAHOO.util.DataSource(YAHOO.util.Dom.get("table1"));
          > myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
          > myDataSource.responseSchema = {
          > fields: [{key:"table"},{key:"item"},]
          > };
          >
          > // Instantiate datatable with parsed markup (applies Sam theme)
          > myDataTable = new YAHOO.widget.DataTable("workarea1", myColumnDefs,
          > myDataSource, {
          > sortedBy:{key:"table",dir:"desc"},
          > selectionMode:"single"
          > });
          >
          > // Execute drag-and-drop code on mousedown
          > myDataTable.subscribe("rowMousedownEvent", function(ev) {
          > var rowElement = myDataTable.getTrEl(Event.getTarget(ev));
          >
          > // Create a proxy for showing the row being dragged
          > var ddRow = new YAHOO.util.DDProxy(rowElement.id);
          >
          > // Highlight row selected for dragging
          > ddRow.onMouseDown = function(ev) {
          > myDataTable.highlightRow(rowElement);
          > };
          >
          > ddRow.onMouseUp = function(ev) {
          > myDataTable.unhighlightRow(rowElement);
          > };
          >
          > });
          >
          > var myLogReader = new YAHOO.widget.LogReader();
          > })();
          >
        • Dav Glass
          Peter -- Can you post a link to a working example? Satyam s example is based on mine and they both seem to work.. Dav Dav Glass dav.glass@yahoo.com
          Message 4 of 10 , Jul 3, 2008
            Peter --

            Can you post a link to a working example?

            Satyam's example is based on mine and they both seem to work..

            Dav

            Dav Glass
            dav.glass@...
            blog.davglass.com




            + Windows: n. - The most successful computer virus, ever. +
            + A computer without a Microsoft operating system is like a dog
            without bricks tied to its head +
            + A Microsoft Certified Systems Engineer is to computing what a
            McDonalds Certified Food Specialist is to fine cuisine +



            ----- Original Message ----
            From: whiteboy6969ca <peterdarrow@...>
            To: ydn-javascript@yahoogroups.com
            Sent: Thursday, July 3, 2008 9:36:35 AM
            Subject: [ydn-javascript] Re: DDProxy doesn't respond on first click with DataTable

            Thanks for the response Dav, I didn't want to bother you again with
            this via e-mail. The problem with using that command is that it still
            doesn't execute onMouseDown on the first click, only on the second.
            Thus, when I click to drag, the row doesn't get highlighted like it
            want it (but does create the proxy). I've looked at Satyam's code for
            this at http://www.satyam.com.ar/yui/2.5.0/invoice.html and his works
            without that line, and click + drag + highlight works on the first
            click. I've scoured his code for hints, but I can't find what I'm
            missing. Any other ideas?

            Peter

            --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
            >
            > peterdarrow --
            >
            > You are actually creating the DDProxy on the first click, you need
            to make it active too :)
            >
            > What you are forgetting is the handleMouseDown call on the Proxy
            > ddRow.handleMouseDown(ev.event);
            >
            > This example shows how to do that (around line 30):
            > http://blog.davglass.com/files/yui/datatable4/
            >
            >
            > Hope that helps :D
            > Dav
            >
            > Dav Glass
            > dav.glass@...
            > blog.davglass.com
            >
            >
            >
            >
            > + Windows: n. - The most successful computer virus, ever. +
            > + A computer without a Microsoft operating system is like a dog
            > without bricks tied to its head +
            > + A Microsoft Certified Systems Engineer is to computing what a
            > McDonalds Certified Food Specialist is to fine cuisine +
            >
            >
            >
            > ----- Original Message ----
            > From: whiteboy6969ca <peterdarrow@...>
            > To: ydn-javascript@yahoogroups.com
            > Sent: Thursday, July 3, 2008 8:55:58 AM
            > Subject: [ydn-javascript] DDProxy doesn't respond on first click
            with DataTable
            >
            > DDProxy doesn't respond on first click with DataTable Hi, I'm
            trying to drag and drop rows from a DataTable. The
            > rowMousedownEvent is fired when I click on a row, but the proxy isn't
            > created. It's only created on the second click for any given row. Any
            > ideas? Code:
            > (function() {
            > var Dom = YAHOO.util.Dom,
            > Event = YAHOO.util.Event
            >
            > var myColumnDefs = [
            > {key:"table",label:"Table",sortable:true},
            > {key:"item",label:"Item",sortable:true},
            > ];
            >
            > // Grab table data from existing markup
            > myDataSource = new YAHOO.util.DataSource(YAHOO.util.Dom.get("table1"));
            > myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
            > myDataSource.responseSchema = {
            > fields: [{key:"table"},{key:"item"},]
            > };
            >
            > // Instantiate datatable with parsed markup (applies Sam theme)
            > myDataTable = new YAHOO.widget.DataTable("workarea1", myColumnDefs,
            > myDataSource, {
            > sortedBy:{key:"table",dir:"desc"},
            > selectionMode:"single"
            > });
            >
            > // Execute drag-and-drop code on mousedown
            > myDataTable.subscribe("rowMousedownEvent", function(ev) {
            > var rowElement = myDataTable.getTrEl(Event.getTarget(ev));
            >
            > // Create a proxy for showing the row being dragged
            > var ddRow = new YAHOO.util.DDProxy(rowElement.id);
            >
            > // Highlight row selected for dragging
            > ddRow.onMouseDown = function(ev) {
            > myDataTable.highlightRow(rowElement);
            > };
            >
            > ddRow.onMouseUp = function(ev) {
            > myDataTable.unhighlightRow(rowElement);
            > };
            >
            > });
            >
            > var myLogReader = new YAHOO.widget.LogReader();
            > })();
            >



            ------------------------------------

            Yahoo! Groups Links
          • whiteboy6969ca
            Sure, http://www.accesswave.ca/~ddarrow/test/test.html Notice that although the proxy is created on the first click, the row is only highlighted on the second
            Message 5 of 10 , Jul 3, 2008
              Sure, http://www.accesswave.ca/~ddarrow/test/test.html

              Notice that although the proxy is created on the first click, the row
              is only highlighted on the second click. I'd like it highlighted on
              the first.

              Peter

              --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
              >
              > Peter --
              >
              > Can you post a link to a working example?
              >
              > Satyam's example is based on mine and they both seem to work..
              >
              > Dav
              >
              > Dav Glass
              > dav.glass@...
              > blog.davglass.com
              >
              >
              >
              >
              > + Windows: n. - The most successful computer virus, ever. +
              > + A computer without a Microsoft operating system is like a dog
              > without bricks tied to its head +
              > + A Microsoft Certified Systems Engineer is to computing what a
              > McDonalds Certified Food Specialist is to fine cuisine +
              >
              >
              >
              > ----- Original Message ----
              > From: whiteboy6969ca <peterdarrow@...>
              > To: ydn-javascript@yahoogroups.com
              > Sent: Thursday, July 3, 2008 9:36:35 AM
              > Subject: [ydn-javascript] Re: DDProxy doesn't respond on first click
              with DataTable
              >
              > Thanks for the response Dav, I didn't want to bother you again with
              > this via e-mail. The problem with using that command is that it still
              > doesn't execute onMouseDown on the first click, only on the second.
              > Thus, when I click to drag, the row doesn't get highlighted like it
              > want it (but does create the proxy). I've looked at Satyam's code for
              > this at http://www.satyam.com.ar/yui/2.5.0/invoice.html and his works
              > without that line, and click + drag + highlight works on the first
              > click. I've scoured his code for hints, but I can't find what I'm
              > missing. Any other ideas?
              >
              > Peter
              >
              > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
              > >
              > > peterdarrow --
              > >
              > > You are actually creating the DDProxy on the first click, you need
              > to make it active too :)
              > >
              > > What you are forgetting is the handleMouseDown call on the Proxy
              > > ddRow.handleMouseDown(ev.event);
              > >
              > > This example shows how to do that (around line 30):
              > > http://blog.davglass.com/files/yui/datatable4/
              > >
              > >
              > > Hope that helps :D
              > > Dav
              > >
              > > Dav Glass
              > > dav.glass@
              > > blog.davglass.com
              > >
              > >
              > >
              > >
              > > + Windows: n. - The most successful computer virus, ever. +
              > > + A computer without a Microsoft operating system is like a dog
              > > without bricks tied to its head +
              > > + A Microsoft Certified Systems Engineer is to computing what a
              > > McDonalds Certified Food Specialist is to fine cuisine +
              > >
              > >
              > >
              > > ----- Original Message ----
              > > From: whiteboy6969ca <peterdarrow@>
              > > To: ydn-javascript@yahoogroups.com
              > > Sent: Thursday, July 3, 2008 8:55:58 AM
              > > Subject: [ydn-javascript] DDProxy doesn't respond on first click
              > with DataTable
              > >
              > > DDProxy doesn't respond on first click with DataTable Hi, I'm
              > trying to drag and drop rows from a DataTable. The
              > > rowMousedownEvent is fired when I click on a row, but the proxy isn't
              > > created. It's only created on the second click for any given row. Any
              > > ideas? Code:
              > > (function() {
              > > var Dom = YAHOO.util.Dom,
              > > Event = YAHOO.util.Event
              > >
              > > var myColumnDefs = [
              > > {key:"table",label:"Table",sortable:true},
              > > {key:"item",label:"Item",sortable:true},
              > > ];
              > >
              > > // Grab table data from existing markup
              > > myDataSource = new
              YAHOO.util.DataSource(YAHOO.util.Dom.get("table1"));
              > > myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
              > > myDataSource.responseSchema = {
              > > fields: [{key:"table"},{key:"item"},]
              > > };
              > >
              > > // Instantiate datatable with parsed markup (applies Sam theme)
              > > myDataTable = new YAHOO.widget.DataTable("workarea1",
              myColumnDefs,
              > > myDataSource, {
              > > sortedBy:{key:"table",dir:"desc"},
              > > selectionMode:"single"
              > > });
              > >
              > > // Execute drag-and-drop code on mousedown
              > > myDataTable.subscribe("rowMousedownEvent", function(ev) {
              > > var rowElement =
              myDataTable.getTrEl(Event.getTarget(ev));
              > >
              > > // Create a proxy for showing the row being dragged
              > > var ddRow = new YAHOO.util.DDProxy(rowElement.id);
              > >
              > > // Highlight row selected for dragging
              > > ddRow.onMouseDown = function(ev) {
              > > myDataTable.highlightRow(rowElement);
              > > };
              > >
              > > ddRow.onMouseUp = function(ev) {
              > > myDataTable.unhighlightRow(rowElement);
              > > };
              > >
              > > });
              > >
              > > var myLogReader = new YAHOO.widget.LogReader();
              > > })();
              > >
              >
              >
              >
              > ------------------------------------
              >
              > Yahoo! Groups Links
              >
            • Dav Glass
              For me that proxy is moving fine, just the row is not highlighting.. Try changing this: ddRow.onMouseDown = function(ev) {
              Message 6 of 10 , Jul 3, 2008
                For me that proxy is moving fine, just the row is not highlighting..

                Try changing this:
                ddRow.onMouseDown = function(ev) {
                myDataTable.highlightRow(rowElement);
                };

                to this:
                myDataTable.highlightRow(rowElement);


                Does that help?
                Dav
                Dav Glass
                dav.glass@...
                blog.davglass.com




                + Windows: n. - The most successful computer virus, ever. +
                + A computer without a Microsoft operating system is like a dog
                without bricks tied to its head +
                + A Microsoft Certified Systems Engineer is to computing what a
                McDonalds Certified Food Specialist is to fine cuisine +



                ----- Original Message ----
                From: whiteboy6969ca <peterdarrow@...>
                To: ydn-javascript@yahoogroups.com
                Sent: Thursday, July 3, 2008 10:02:35 AM
                Subject: [ydn-javascript] Re: DDProxy doesn't respond on first click with DataTable

                Sure, http://www.accesswave.ca/~ddarrow/test/test.html

                Notice that although the proxy is created on the first click, the row
                is only highlighted on the second click. I'd like it highlighted on
                the first.

                Peter

                --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
                >
                > Peter --
                >
                > Can you post a link to a working example?
                >
                > Satyam's example is based on mine and they both seem to work..
                >
                > Dav
                >
                > Dav Glass
                > dav.glass@...
                > blog.davglass.com
                >
                >
                >
                >
                > + Windows: n. - The most successful computer virus, ever. +
                > + A computer without a Microsoft operating system is like a dog
                > without bricks tied to its head +
                > + A Microsoft Certified Systems Engineer is to computing what a
                > McDonalds Certified Food Specialist is to fine cuisine +
                >
                >
                >
                > ----- Original Message ----
                > From: whiteboy6969ca <peterdarrow@...>
                > To: ydn-javascript@yahoogroups.com
                > Sent: Thursday, July 3, 2008 9:36:35 AM
                > Subject: [ydn-javascript] Re: DDProxy doesn't respond on first click
                with DataTable
                >
                > Thanks for the response Dav, I didn't want to bother you again with
                > this via e-mail. The problem with using that command is that it still
                > doesn't execute onMouseDown on the first click, only on the second.
                > Thus, when I click to drag, the row doesn't get highlighted like it
                > want it (but does create the proxy). I've looked at Satyam's code for
                > this at http://www.satyam.com.ar/yui/2.5.0/invoice.html and his works
                > without that line, and click + drag + highlight works on the first
                > click. I've scoured his code for hints, but I can't find what I'm
                > missing. Any other ideas?
                >
                > Peter
                >
                > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                > >
                > > peterdarrow --
                > >
                > > You are actually creating the DDProxy on the first click, you need
                > to make it active too :)
                > >
                > > What you are forgetting is the handleMouseDown call on the Proxy
                > > ddRow.handleMouseDown(ev.event);
                > >
                > > This example shows how to do that (around line 30):
                > > http://blog.davglass.com/files/yui/datatable4/
                > >
                > >
                > > Hope that helps :D
                > > Dav
                > >
                > > Dav Glass
                > > dav.glass@
                > > blog.davglass.com
                > >
                > >
                > >
                > >
                > > + Windows: n. - The most successful computer virus, ever. +
                > > + A computer without a Microsoft operating system is like a dog
                > > without bricks tied to its head +
                > > + A Microsoft Certified Systems Engineer is to computing what a
                > > McDonalds Certified Food Specialist is to fine cuisine +
                > >
                > >
                > >
                > > ----- Original Message ----
                > > From: whiteboy6969ca <peterdarrow@>
                > > To: ydn-javascript@yahoogroups.com
                > > Sent: Thursday, July 3, 2008 8:55:58 AM
                > > Subject: [ydn-javascript] DDProxy doesn't respond on first click
                > with DataTable
                > >
                > > DDProxy doesn't respond on first click with DataTable Hi, I'm
                > trying to drag and drop rows from a DataTable. The
                > > rowMousedownEvent is fired when I click on a row, but the proxy isn't
                > > created. It's only created on the second click for any given row. Any
                > > ideas? Code:
                > > (function() {
                > > var Dom = YAHOO.util.Dom,
                > > Event = YAHOO.util.Event
                > >
                > > var myColumnDefs = [
                > > {key:"table",label:"Table",sortable:true},
                > > {key:"item",label:"Item",sortable:true},
                > > ];
                > >
                > > // Grab table data from existing markup
                > > myDataSource = new
                YAHOO.util.DataSource(YAHOO.util.Dom.get("table1"));
                > > myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE;
                > > myDataSource.responseSchema = {
                > > fields: [{key:"table"},{key:"item"},]
                > > };
                > >
                > > // Instantiate datatable with parsed markup (applies Sam theme)
                > > myDataTable = new YAHOO.widget.DataTable("workarea1",
                myColumnDefs,
                > > myDataSource, {
                > > sortedBy:{key:"table",dir:"desc"},
                > > selectionMode:"single"
                > > });
                > >
                > > // Execute drag-and-drop code on mousedown
                > > myDataTable.subscribe("rowMousedownEvent", function(ev) {
                > > var rowElement =
                myDataTable.getTrEl(Event.getTarget(ev));
                > >
                > > // Create a proxy for showing the row being dragged
                > > var ddRow = new YAHOO.util.DDProxy(rowElement.id);
                > >
                > > // Highlight row selected for dragging
                > > ddRow.onMouseDown = function(ev) {
                > > myDataTable.highlightRow(rowElement);
                > > };
                > >
                > > ddRow.onMouseUp = function(ev) {
                > > myDataTable.unhighlightRow(rowElement);
                > > };
                > >
                > > });
                > >
                > > var myLogReader = new YAHOO.widget.LogReader();
                > > })();
                > >
                >
                >
                >
                > ------------------------------------
                >
                > Yahoo! Groups Links
                >



                ------------------------------------

                Yahoo! Groups Links
              • whiteboy6969ca
                That works, but then subsequent drags on the same row do not get highlighted (I ve updated the script to show you). But if I add both, i.e.
                Message 7 of 10 , Jul 3, 2008
                  That works, but then subsequent drags on the same row do not get
                  highlighted (I've updated the script to show you). But if I add both, i.e.

                  myDataTable.highlightRow(rowElement);

                  // AND

                  ddRow.onMouseDown = function(ev) {
                  myDataTable.highlightRow(rowElement);
                  };

                  ... then highlighting works in all cases.

                  Is this a YUI bug that I should file?

                  Thanks for the help Dav,
                  Peter

                  --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
                  >
                  > For me that proxy is moving fine, just the row is not highlighting..
                  >
                  > Try changing this:
                  > ddRow.onMouseDown = function(ev) {
                  > myDataTable.highlightRow(rowElement);
                  > };
                  >
                  > to this:
                  > myDataTable.highlightRow(rowElement);
                  >
                  >
                  > Does that help?
                  > Dav
                  > Dav Glass
                  > dav.glass@...
                  > blog.davglass.com
                  >
                  >
                  >
                  >
                  > + Windows: n. - The most successful computer virus, ever. +
                  > + A computer without a Microsoft operating system is like a dog
                  > without bricks tied to its head +
                  > + A Microsoft Certified Systems Engineer is to computing what a
                  > McDonalds Certified Food Specialist is to fine cuisine +
                  >
                  >
                  >
                  > ----- Original Message ----
                  > From: whiteboy6969ca <peterdarrow@...>
                  > To: ydn-javascript@yahoogroups.com
                  > Sent: Thursday, July 3, 2008 10:02:35 AM
                  > Subject: [ydn-javascript] Re: DDProxy doesn't respond on first click
                  with DataTable
                  >
                  > Sure, http://www.accesswave.ca/~ddarrow/test/test.html
                  >
                  > Notice that although the proxy is created on the first click, the row
                  > is only highlighted on the second click. I'd like it highlighted on
                  > the first.
                  >
                  > Peter
                  >
                  > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                  > >
                  > > Peter --
                  > >
                  > > Can you post a link to a working example?
                  > >
                  > > Satyam's example is based on mine and they both seem to work..
                  > >
                  > > Dav
                  > >
                  > > Dav Glass
                  > > dav.glass@
                  > > blog.davglass.com
                  > >
                  > >
                  > >
                  > >
                  > > + Windows: n. - The most successful computer virus, ever. +
                  > > + A computer without a Microsoft operating system is like a dog
                  > > without bricks tied to its head +
                  > > + A Microsoft Certified Systems Engineer is to computing what a
                  > > McDonalds Certified Food Specialist is to fine cuisine +
                  > >
                  > >
                  > >
                  > > ----- Original Message ----
                  > > From: whiteboy6969ca <peterdarrow@>
                  > > To: ydn-javascript@yahoogroups.com
                  > > Sent: Thursday, July 3, 2008 9:36:35 AM
                  > > Subject: [ydn-javascript] Re: DDProxy doesn't respond on first click
                  > with DataTable
                  > >
                  > > Thanks for the response Dav, I didn't want to bother you again with
                  > > this via e-mail. The problem with using that command is that it still
                  > > doesn't execute onMouseDown on the first click, only on the second.
                  > > Thus, when I click to drag, the row doesn't get highlighted like it
                  > > want it (but does create the proxy). I've looked at Satyam's code for
                  > > this at http://www.satyam.com.ar/yui/2.5.0/invoice.html and his works
                  > > without that line, and click + drag + highlight works on the first
                  > > click. I've scoured his code for hints, but I can't find what I'm
                  > > missing. Any other ideas?
                  > >
                  > > Peter
                  > >
                  > > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                  > > >
                  > > > peterdarrow --
                  > > >
                  > > > You are actually creating the DDProxy on the first click, you need
                  > > to make it active too :)
                  > > >
                  > > > What you are forgetting is the handleMouseDown call on the Proxy
                  > > > ddRow.handleMouseDown(ev.event);
                  > > >
                  > > > This example shows how to do that (around line 30):
                  > > > http://blog.davglass.com/files/yui/datatable4/
                  > > >
                  > > >
                  > > > Hope that helps :D
                  > > > Dav
                  > > >
                  > > > Dav Glass
                  > > > dav.glass@
                  > > > blog.davglass.com
                  > > >
                  > > >
                  > > >
                  > > >
                  > > > + Windows: n. - The most successful computer virus, ever. +
                  > > > + A computer without a Microsoft operating system is like a dog
                  > > > without bricks tied to its head +
                  > > > + A Microsoft Certified Systems Engineer is to computing what a
                  > > > McDonalds Certified Food Specialist is to fine cuisine +
                  > > >
                  > > >
                  > > >
                  > > > ----- Original Message ----
                  > > > From: whiteboy6969ca <peterdarrow@>
                  > > > To: ydn-javascript@yahoogroups.com
                  > > > Sent: Thursday, July 3, 2008 8:55:58 AM
                  > > > Subject: [ydn-javascript] DDProxy doesn't respond on first click
                  > > with DataTable
                  > > >
                  > > > DDProxy doesn't respond on first click with DataTable Hi, I'm
                  > > trying to drag and drop rows from a DataTable. The
                  > > > rowMousedownEvent is fired when I click on a row, but the proxy
                  isn't
                  > > > created. It's only created on the second click for any given
                  row. Any
                  > > > ideas? Code:
                  > > > (function() {
                  > > > var Dom = YAHOO.util.Dom,
                  > > > Event = YAHOO.util.Event
                  > > >
                  > > > var myColumnDefs = [
                  > > > {key:"table",label:"Table",sortable:true},
                  > > > {key:"item",label:"Item",sortable:true},
                  > > > ];
                  > > >
                  > > > // Grab table data from existing markup
                  > > > myDataSource = new
                  > YAHOO.util.DataSource(YAHOO.util.Dom.get("table1"));
                  > > > myDataSource.responseType =
                  YAHOO.util.DataSource.TYPE_HTMLTABLE;
                  > > > myDataSource.responseSchema = {
                  > > > fields: [{key:"table"},{key:"item"},]
                  > > > };
                  > > >
                  > > > // Instantiate datatable with parsed markup (applies Sam theme)
                  > > > myDataTable = new YAHOO.widget.DataTable("workarea1",
                  > myColumnDefs,
                  > > > myDataSource, {
                  > > > sortedBy:{key:"table",dir:"desc"},
                  > > > selectionMode:"single"
                  > > > });
                  > > >
                  > > > // Execute drag-and-drop code on mousedown
                  > > > myDataTable.subscribe("rowMousedownEvent", function(ev) {
                  > > > var rowElement =
                  > myDataTable.getTrEl(Event.getTarget(ev));
                  > > >
                  > > > // Create a proxy for showing the row being dragged
                  > > > var ddRow = new YAHOO.util.DDProxy(rowElement.id);
                  > > >
                  > > > // Highlight row selected for dragging
                  > > > ddRow.onMouseDown = function(ev) {
                  > > > myDataTable.highlightRow(rowElement);
                  > > > };
                  > > >
                  > > > ddRow.onMouseUp = function(ev) {
                  > > > myDataTable.unhighlightRow(rowElement);
                  > > > };
                  > > >
                  > > > });
                  > > >
                  > > > var myLogReader = new YAHOO.widget.LogReader();
                  > > > })();
                  > > >
                  > >
                  > >
                  > >
                  > > ------------------------------------
                  > >
                  > > Yahoo! Groups Links
                  > >
                  >
                  >
                  >
                  > ------------------------------------
                  >
                  > Yahoo! Groups Links
                  >
                • Dav Glass
                  It s not really a bug.. Since you are creating the DDProxy on mousedown, DDProxy s mousedown event has already fired. So that event will not fire the first
                  Message 8 of 10 , Jul 3, 2008
                    It's not really a bug..

                    Since you are creating the DDProxy on mousedown, DDProxy's mousedown event has already fired. So that event will not fire the first time..


                    It's kind of a chicken and the egg thing..

                    Make sense?

                    Dav

                    Dav Glass
                    dav.glass@...
                    blog.davglass.com




                    + Windows: n. - The most successful computer virus, ever. +
                    + A computer without a Microsoft operating system is like a dog
                    without bricks tied to its head +
                    + A Microsoft Certified Systems Engineer is to computing what a
                    McDonalds Certified Food Specialist is to fine cuisine +



                    ----- Original Message ----
                    From: whiteboy6969ca <peterdarrow@...>
                    To: ydn-javascript@yahoogroups.com
                    Sent: Thursday, July 3, 2008 10:55:42 AM
                    Subject: [ydn-javascript] Re: DDProxy doesn't respond on first click with DataTable

                    That works, but then subsequent drags on the same row do not get
                    highlighted (I've updated the script to show you). But if I add both, i.e.

                    myDataTable.highlightRow(rowElement);

                    // AND

                    ddRow.onMouseDown = function(ev) {
                    myDataTable.highlightRow(rowElement);
                    };

                    ... then highlighting works in all cases.

                    Is this a YUI bug that I should file?

                    Thanks for the help Dav,
                    Peter

                    --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
                    >
                    > For me that proxy is moving fine, just the row is not highlighting..
                    >
                    > Try changing this:
                    > ddRow.onMouseDown = function(ev) {
                    > myDataTable.highlightRow(rowElement);
                    > };
                    >
                    > to this:
                    > myDataTable.highlightRow(rowElement);
                    >
                    >
                    > Does that help?
                    > Dav
                    > Dav Glass
                    > dav.glass@...
                    > blog.davglass.com
                    >
                    >
                    >
                    >
                    > + Windows: n. - The most successful computer virus, ever. +
                    > + A computer without a Microsoft operating system is like a dog
                    > without bricks tied to its head +
                    > + A Microsoft Certified Systems Engineer is to computing what a
                    > McDonalds Certified Food Specialist is to fine cuisine +
                    >
                    >
                    >
                    > ----- Original Message ----
                    > From: whiteboy6969ca <peterdarrow@...>
                    > To: ydn-javascript@yahoogroups.com
                    > Sent: Thursday, July 3, 2008 10:02:35 AM
                    > Subject: [ydn-javascript] Re: DDProxy doesn't respond on first click
                    with DataTable
                    >
                    > Sure, http://www.accesswave.ca/~ddarrow/test/test.html
                    >
                    > Notice that although the proxy is created on the first click, the row
                    > is only highlighted on the second click. I'd like it highlighted on
                    > the first.
                    >
                    > Peter
                    >
                    > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                    > >
                    > > Peter --
                    > >
                    > > Can you post a link to a working example?
                    > >
                    > > Satyam's example is based on mine and they both seem to work..
                    > >
                    > > Dav
                    > >
                    > > Dav Glass
                    > > dav.glass@
                    > > blog.davglass.com
                    > >
                    > >
                    > >
                    > >
                    > > + Windows: n. - The most successful computer virus, ever. +
                    > > + A computer without a Microsoft operating system is like a dog
                    > > without bricks tied to its head +
                    > > + A Microsoft Certified Systems Engineer is to computing what a
                    > > McDonalds Certified Food Specialist is to fine cuisine +
                    > >
                    > >
                    > >
                    > > ----- Original Message ----
                    > > From: whiteboy6969ca <peterdarrow@>
                    > > To: ydn-javascript@yahoogroups.com
                    > > Sent: Thursday, July 3, 2008 9:36:35 AM
                    > > Subject: [ydn-javascript] Re: DDProxy doesn't respond on first click
                    > with DataTable
                    > >
                    > > Thanks for the response Dav, I didn't want to bother you again with
                    > > this via e-mail. The problem with using that command is that it still
                    > > doesn't execute onMouseDown on the first click, only on the second.
                    > > Thus, when I click to drag, the row doesn't get highlighted like it
                    > > want it (but does create the proxy). I've looked at Satyam's code for
                    > > this at http://www.satyam.com.ar/yui/2.5.0/invoice.html and his works
                    > > without that line, and click + drag + highlight works on the first
                    > > click. I've scoured his code for hints, but I can't find what I'm
                    > > missing. Any other ideas?
                    > >
                    > > Peter
                    > >
                    > > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                    > > >
                    > > > peterdarrow --
                    > > >
                    > > > You are actually creating the DDProxy on the first click, you need
                    > > to make it active too :)
                    > > >
                    > > > What you are forgetting is the handleMouseDown call on the Proxy
                    > > > ddRow.handleMouseDown(ev.event);
                    > > >
                    > > > This example shows how to do that (around line 30):
                    > > > http://blog.davglass.com/files/yui/datatable4/
                    > > >
                    > > >
                    > > > Hope that helps :D
                    > > > Dav
                    > > >
                    > > > Dav Glass
                    > > > dav.glass@
                    > > > blog.davglass.com
                    > > >
                    > > >
                    > > >
                    > > >
                    > > > + Windows: n. - The most successful computer virus, ever. +
                    > > > + A computer without a Microsoft operating system is like a dog
                    > > > without bricks tied to its head +
                    > > > + A Microsoft Certified Systems Engineer is to computing what a
                    > > > McDonalds Certified Food Specialist is to fine cuisine +
                    > > >
                    > > >
                    > > >
                    > > > ----- Original Message ----
                    > > > From: whiteboy6969ca <peterdarrow@>
                    > > > To: ydn-javascript@yahoogroups.com
                    > > > Sent: Thursday, July 3, 2008 8:55:58 AM
                    > > > Subject: [ydn-javascript] DDProxy doesn't respond on first click
                    > > with DataTable
                    > > >
                    > > > DDProxy doesn't respond on first click with DataTable Hi, I'm
                    > > trying to drag and drop rows from a DataTable. The
                    > > > rowMousedownEvent is fired when I click on a row, but the proxy
                    isn't
                    > > > created. It's only created on the second click for any given
                    row. Any
                    > > > ideas? Code:
                    > > > (function() {
                    > > > var Dom = YAHOO.util.Dom,
                    > > > Event = YAHOO.util.Event
                    > > >
                    > > > var myColumnDefs = [
                    > > > {key:"table",label:"Table",sortable:true},
                    > > > {key:"item",label:"Item",sortable:true},
                    > > > ];
                    > > >
                    > > > // Grab table data from existing markup
                    > > > myDataSource = new
                    > YAHOO.util.DataSource(YAHOO.util.Dom.get("table1"));
                    > > > myDataSource.responseType =
                    YAHOO.util.DataSource.TYPE_HTMLTABLE;
                    > > > myDataSource.responseSchema = {
                    > > > fields: [{key:"table"},{key:"item"},]
                    > > > };
                    > > >
                    > > > // Instantiate datatable with parsed markup (applies Sam theme)
                    > > > myDataTable = new YAHOO.widget.DataTable("workarea1",
                    > myColumnDefs,
                    > > > myDataSource, {
                    > > > sortedBy:{key:"table",dir:"desc"},
                    > > > selectionMode:"single"
                    > > > });
                    > > >
                    > > > // Execute drag-and-drop code on mousedown
                    > > > myDataTable.subscribe("rowMousedownEvent", function(ev) {
                    > > > var rowElement =
                    > myDataTable.getTrEl(Event.getTarget(ev));
                    > > >
                    > > > // Create a proxy for showing the row being dragged
                    > > > var ddRow = new YAHOO.util.DDProxy(rowElement.id);
                    > > >
                    > > > // Highlight row selected for dragging
                    > > > ddRow.onMouseDown = function(ev) {
                    > > > myDataTable.highlightRow(rowElement);
                    > > > };
                    > > >
                    > > > ddRow.onMouseUp = function(ev) {
                    > > > myDataTable.unhighlightRow(rowElement);
                    > > > };
                    > > >
                    > > > });
                    > > >
                    > > > var myLogReader = new YAHOO.widget.LogReader();
                    > > > })();
                    > > >
                    > >
                    > >
                    > >
                    > > ------------------------------------
                    > >
                    > > Yahoo! Groups Links
                    > >
                    >
                    >
                    >
                    > ------------------------------------
                    >
                    > Yahoo! Groups Links
                    >



                    ------------------------------------

                    Yahoo! Groups Links
                  • whiteboy6969ca
                    Oh I get it. So would a better alternative be to generate all the proxies before subscribing to the rowMousedownEvent? ... event has already fired. So that
                    Message 9 of 10 , Jul 3, 2008
                      Oh I get it. So would a better alternative be to generate all the
                      proxies before subscribing to the rowMousedownEvent?

                      --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
                      >
                      > It's not really a bug..
                      >
                      > Since you are creating the DDProxy on mousedown, DDProxy's mousedown
                      event has already fired. So that event will not fire the first time..
                      >
                      >
                      > It's kind of a chicken and the egg thing..
                      >
                      > Make sense?
                      >
                      > Dav
                      >
                      > Dav Glass
                      > dav.glass@...
                      > blog.davglass.com
                      >
                      >
                      >
                      >
                      > + Windows: n. - The most successful computer virus, ever. +
                      > + A computer without a Microsoft operating system is like a dog
                      > without bricks tied to its head +
                      > + A Microsoft Certified Systems Engineer is to computing what a
                      > McDonalds Certified Food Specialist is to fine cuisine +
                      >
                      >
                      >
                      > ----- Original Message ----
                      > From: whiteboy6969ca <peterdarrow@...>
                      > To: ydn-javascript@yahoogroups.com
                      > Sent: Thursday, July 3, 2008 10:55:42 AM
                      > Subject: [ydn-javascript] Re: DDProxy doesn't respond on first click
                      with DataTable
                      >
                      > That works, but then subsequent drags on the same row do not get
                      > highlighted (I've updated the script to show you). But if I add
                      both, i.e.
                      >
                      > myDataTable.highlightRow(rowElement);
                      >
                      > // AND
                      >
                      > ddRow.onMouseDown = function(ev) {
                      > myDataTable.highlightRow(rowElement);
                      > };
                      >
                      > ... then highlighting works in all cases.
                      >
                      > Is this a YUI bug that I should file?
                      >
                      > Thanks for the help Dav,
                      > Peter
                      >
                      > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                      > >
                      > > For me that proxy is moving fine, just the row is not highlighting..
                      > >
                      > > Try changing this:
                      > > ddRow.onMouseDown = function(ev) {
                      > > myDataTable.highlightRow(rowElement);
                      > > };
                      > >
                      > > to this:
                      > > myDataTable.highlightRow(rowElement);
                      > >
                      > >
                      > > Does that help?
                      > > Dav
                      > > Dav Glass
                      > > dav.glass@
                      > > blog.davglass.com
                      > >
                      > >
                      > >
                      > >
                      > > + Windows: n. - The most successful computer virus, ever. +
                      > > + A computer without a Microsoft operating system is like a dog
                      > > without bricks tied to its head +
                      > > + A Microsoft Certified Systems Engineer is to computing what a
                      > > McDonalds Certified Food Specialist is to fine cuisine +
                      > >
                      > >
                      > >
                      > > ----- Original Message ----
                      > > From: whiteboy6969ca <peterdarrow@>
                      > > To: ydn-javascript@yahoogroups.com
                      > > Sent: Thursday, July 3, 2008 10:02:35 AM
                      > > Subject: [ydn-javascript] Re: DDProxy doesn't respond on first click
                      > with DataTable
                      > >
                      > > Sure, http://www.accesswave.ca/~ddarrow/test/test.html
                      > >
                      > > Notice that although the proxy is created on the first click, the row
                      > > is only highlighted on the second click. I'd like it highlighted on
                      > > the first.
                      > >
                      > > Peter
                      > >
                      > > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                      > > >
                      > > > Peter --
                      > > >
                      > > > Can you post a link to a working example?
                      > > >
                      > > > Satyam's example is based on mine and they both seem to work..
                      > > >
                      > > > Dav
                      > > >
                      > > > Dav Glass
                      > > > dav.glass@
                      > > > blog.davglass.com
                      > > >
                      > > >
                      > > >
                      > > >
                      > > > + Windows: n. - The most successful computer virus, ever. +
                      > > > + A computer without a Microsoft operating system is like a dog
                      > > > without bricks tied to its head +
                      > > > + A Microsoft Certified Systems Engineer is to computing what a
                      > > > McDonalds Certified Food Specialist is to fine cuisine +
                      > > >
                      > > >
                      > > >
                      > > > ----- Original Message ----
                      > > > From: whiteboy6969ca <peterdarrow@>
                      > > > To: ydn-javascript@yahoogroups.com
                      > > > Sent: Thursday, July 3, 2008 9:36:35 AM
                      > > > Subject: [ydn-javascript] Re: DDProxy doesn't respond on first click
                      > > with DataTable
                      > > >
                      > > > Thanks for the response Dav, I didn't want to bother you again with
                      > > > this via e-mail. The problem with using that command is that it
                      still
                      > > > doesn't execute onMouseDown on the first click, only on the second.
                      > > > Thus, when I click to drag, the row doesn't get highlighted like it
                      > > > want it (but does create the proxy). I've looked at Satyam's
                      code for
                      > > > this at http://www.satyam.com.ar/yui/2.5.0/invoice.html and his
                      works
                      > > > without that line, and click + drag + highlight works on the first
                      > > > click. I've scoured his code for hints, but I can't find what I'm
                      > > > missing. Any other ideas?
                      > > >
                      > > > Peter
                      > > >
                      > > > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                      > > > >
                      > > > > peterdarrow --
                      > > > >
                      > > > > You are actually creating the DDProxy on the first click, you need
                      > > > to make it active too :)
                      > > > >
                      > > > > What you are forgetting is the handleMouseDown call on the Proxy
                      > > > > ddRow.handleMouseDown(ev.event);
                      > > > >
                      > > > > This example shows how to do that (around line 30):
                      > > > > http://blog.davglass.com/files/yui/datatable4/
                      > > > >
                      > > > >
                      > > > > Hope that helps :D
                      > > > > Dav
                      > > > >
                      > > > > Dav Glass
                      > > > > dav.glass@
                      > > > > blog.davglass.com
                      > > > >
                      > > > >
                      > > > >
                      > > > >
                      > > > > + Windows: n. - The most successful computer virus, ever. +
                      > > > > + A computer without a Microsoft operating system is like a dog
                      > > > > without bricks tied to its head +
                      > > > > + A Microsoft Certified Systems Engineer is to computing what a
                      > > > > McDonalds Certified Food Specialist is to fine cuisine +
                      > > > >
                      > > > >
                      > > > >
                      > > > > ----- Original Message ----
                      > > > > From: whiteboy6969ca <peterdarrow@>
                      > > > > To: ydn-javascript@yahoogroups.com
                      > > > > Sent: Thursday, July 3, 2008 8:55:58 AM
                      > > > > Subject: [ydn-javascript] DDProxy doesn't respond on first click
                      > > > with DataTable
                      > > > >
                      > > > > DDProxy doesn't respond on first click with DataTable Hi, I'm
                      > > > trying to drag and drop rows from a DataTable. The
                      > > > > rowMousedownEvent is fired when I click on a row, but the proxy
                      > isn't
                      > > > > created. It's only created on the second click for any given
                      > row. Any
                      > > > > ideas? Code:
                      > > > > (function() {
                      > > > > var Dom = YAHOO.util.Dom,
                      > > > > Event = YAHOO.util.Event
                      > > > >
                      > > > > var myColumnDefs = [
                      > > > > {key:"table",label:"Table",sortable:true},
                      > > > > {key:"item",label:"Item",sortable:true},
                      > > > > ];
                      > > > >
                      > > > > // Grab table data from existing markup
                      > > > > myDataSource = new
                      > > YAHOO.util.DataSource(YAHOO.util.Dom.get("table1"));
                      > > > > myDataSource.responseType =
                      > YAHOO.util.DataSource.TYPE_HTMLTABLE;
                      > > > > myDataSource.responseSchema = {
                      > > > > fields: [{key:"table"},{key:"item"},]
                      > > > > };
                      > > > >
                      > > > > // Instantiate datatable with parsed markup (applies Sam
                      theme)
                      > > > > myDataTable = new YAHOO.widget.DataTable("workarea1",
                      > > myColumnDefs,
                      > > > > myDataSource, {
                      > > > > sortedBy:{key:"table",dir:"desc"},
                      > > > > selectionMode:"single"
                      > > > > });
                      > > > >
                      > > > > // Execute drag-and-drop code on mousedown
                      > > > > myDataTable.subscribe("rowMousedownEvent", function(ev) {
                      > > > > var rowElement =
                      > > myDataTable.getTrEl(Event.getTarget(ev));
                      > > > >
                      > > > > // Create a proxy for showing the row being dragged
                      > > > > var ddRow = new YAHOO.util.DDProxy(rowElement.id);
                      > > > >
                      > > > > // Highlight row selected for dragging
                      > > > > ddRow.onMouseDown = function(ev) {
                      > > > > myDataTable.highlightRow(rowElement);
                      > > > > };
                      > > > >
                      > > > > ddRow.onMouseUp = function(ev) {
                      > > > > myDataTable.unhighlightRow(rowElement);
                      > > > > };
                      > > > >
                      > > > > });
                      > > > >
                      > > > > var myLogReader = new YAHOO.widget.LogReader();
                      > > > > })();
                      > > > >
                      > > >
                      > > >
                      > > >
                      > > > ------------------------------------
                      > > >
                      > > > Yahoo! Groups Links
                      > > >
                      > >
                      > >
                      > >
                      > > ------------------------------------
                      > >
                      > > Yahoo! Groups Links
                      > >
                      >
                      >
                      >
                      > ------------------------------------
                      >
                      > Yahoo! Groups Links
                      >
                    • Dav Glass
                      The only issue with that is you have to track the addition and removal of table rows and sync the DDProxy objects on them.. Satyam s example is nice, in that
                      Message 10 of 10 , Jul 3, 2008
                        The only issue with that is you have to track the addition and removal of table rows and sync the DDProxy objects on them..

                        Satyam's example is nice, in that he creates the DDProxy on the table and not the rows, then figures which one triggered it and then moves it..

                        Dav


                        Dav Glass
                        dav.glass@...
                        blog.davglass.com




                        + Windows: n. - The most successful computer virus, ever. +
                        + A computer without a Microsoft operating system is like a dog
                        without bricks tied to its head +
                        + A Microsoft Certified Systems Engineer is to computing what a
                        McDonalds Certified Food Specialist is to fine cuisine +



                        ----- Original Message ----
                        From: whiteboy6969ca <peterdarrow@...>
                        To: ydn-javascript@yahoogroups.com
                        Sent: Thursday, July 3, 2008 11:04:56 AM
                        Subject: [ydn-javascript] Re: DDProxy doesn't respond on first click with DataTable

                        Oh I get it. So would a better alternative be to generate all the
                        proxies before subscribing to the rowMousedownEvent?

                        --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@...> wrote:
                        >
                        > It's not really a bug..
                        >
                        > Since you are creating the DDProxy on mousedown, DDProxy's mousedown
                        event has already fired. So that event will not fire the first time..
                        >
                        >
                        > It's kind of a chicken and the egg thing..
                        >
                        > Make sense?
                        >
                        > Dav
                        >
                        > Dav Glass
                        > dav.glass@...
                        > blog.davglass.com
                        >
                        >
                        >
                        >
                        > + Windows: n. - The most successful computer virus, ever. +
                        > + A computer without a Microsoft operating system is like a dog
                        > without bricks tied to its head +
                        > + A Microsoft Certified Systems Engineer is to computing what a
                        > McDonalds Certified Food Specialist is to fine cuisine +
                        >
                        >
                        >
                        > ----- Original Message ----
                        > From: whiteboy6969ca <peterdarrow@...>
                        > To: ydn-javascript@yahoogroups.com
                        > Sent: Thursday, July 3, 2008 10:55:42 AM
                        > Subject: [ydn-javascript] Re: DDProxy doesn't respond on first click
                        with DataTable
                        >
                        > That works, but then subsequent drags on the same row do not get
                        > highlighted (I've updated the script to show you). But if I add
                        both, i.e.
                        >
                        > myDataTable.highlightRow(rowElement);
                        >
                        > // AND
                        >
                        > ddRow.onMouseDown = function(ev) {
                        > myDataTable.highlightRow(rowElement);
                        > };
                        >
                        > ... then highlighting works in all cases.
                        >
                        > Is this a YUI bug that I should file?
                        >
                        > Thanks for the help Dav,
                        > Peter
                        >
                        > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                        > >
                        > > For me that proxy is moving fine, just the row is not highlighting..
                        > >
                        > > Try changing this:
                        > > ddRow.onMouseDown = function(ev) {
                        > > myDataTable.highlightRow(rowElement);
                        > > };
                        > >
                        > > to this:
                        > > myDataTable.highlightRow(rowElement);
                        > >
                        > >
                        > > Does that help?
                        > > Dav
                        > > Dav Glass
                        > > dav.glass@
                        > > blog.davglass.com
                        > >
                        > >
                        > >
                        > >
                        > > + Windows: n. - The most successful computer virus, ever. +
                        > > + A computer without a Microsoft operating system is like a dog
                        > > without bricks tied to its head +
                        > > + A Microsoft Certified Systems Engineer is to computing what a
                        > > McDonalds Certified Food Specialist is to fine cuisine +
                        > >
                        > >
                        > >
                        > > ----- Original Message ----
                        > > From: whiteboy6969ca <peterdarrow@>
                        > > To: ydn-javascript@yahoogroups.com
                        > > Sent: Thursday, July 3, 2008 10:02:35 AM
                        > > Subject: [ydn-javascript] Re: DDProxy doesn't respond on first click
                        > with DataTable
                        > >
                        > > Sure, http://www.accesswave.ca/~ddarrow/test/test.html
                        > >
                        > > Notice that although the proxy is created on the first click, the row
                        > > is only highlighted on the second click. I'd like it highlighted on
                        > > the first.
                        > >
                        > > Peter
                        > >
                        > > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                        > > >
                        > > > Peter --
                        > > >
                        > > > Can you post a link to a working example?
                        > > >
                        > > > Satyam's example is based on mine and they both seem to work..
                        > > >
                        > > > Dav
                        > > >
                        > > > Dav Glass
                        > > > dav.glass@
                        > > > blog.davglass.com
                        > > >
                        > > >
                        > > >
                        > > >
                        > > > + Windows: n. - The most successful computer virus, ever. +
                        > > > + A computer without a Microsoft operating system is like a dog
                        > > > without bricks tied to its head +
                        > > > + A Microsoft Certified Systems Engineer is to computing what a
                        > > > McDonalds Certified Food Specialist is to fine cuisine +
                        > > >
                        > > >
                        > > >
                        > > > ----- Original Message ----
                        > > > From: whiteboy6969ca <peterdarrow@>
                        > > > To: ydn-javascript@yahoogroups.com
                        > > > Sent: Thursday, July 3, 2008 9:36:35 AM
                        > > > Subject: [ydn-javascript] Re: DDProxy doesn't respond on first click
                        > > with DataTable
                        > > >
                        > > > Thanks for the response Dav, I didn't want to bother you again with
                        > > > this via e-mail. The problem with using that command is that it
                        still
                        > > > doesn't execute onMouseDown on the first click, only on the second.
                        > > > Thus, when I click to drag, the row doesn't get highlighted like it
                        > > > want it (but does create the proxy). I've looked at Satyam's
                        code for
                        > > > this at http://www.satyam.com.ar/yui/2.5.0/invoice.html and his
                        works
                        > > > without that line, and click + drag + highlight works on the first
                        > > > click. I've scoured his code for hints, but I can't find what I'm
                        > > > missing. Any other ideas?
                        > > >
                        > > > Peter
                        > > >
                        > > > --- In ydn-javascript@yahoogroups.com, Dav Glass <dav.glass@> wrote:
                        > > > >
                        > > > > peterdarrow --
                        > > > >
                        > > > > You are actually creating the DDProxy on the first click, you need
                        > > > to make it active too :)
                        > > > >
                        > > > > What you are forgetting is the handleMouseDown call on the Proxy
                        > > > > ddRow.handleMouseDown(ev.event);
                        > > > >
                        > > > > This example shows how to do that (around line 30):
                        > > > > http://blog.davglass.com/files/yui/datatable4/
                        > > > >
                        > > > >
                        > > > > Hope that helps :D
                        > > > > Dav
                        > > > >
                        > > > > Dav Glass
                        > > > > dav.glass@
                        > > > > blog.davglass.com
                        > > > >
                        > > > >
                        > > > >
                        > > > >
                        > > > > + Windows: n. - The most successful computer virus, ever. +
                        > > > > + A computer without a Microsoft operating system is like a dog
                        > > > > without bricks tied to its head +
                        > > > > + A Microsoft Certified Systems Engineer is to computing what a
                        > > > > McDonalds Certified Food Specialist is to fine cuisine +
                        > > > >
                        > > > >
                        > > > >
                        > > > > ----- Original Message ----
                        > > > > From: whiteboy6969ca <peterdarrow@>
                        > > > > To: ydn-javascript@yahoogroups.com
                        > > > > Sent: Thursday, July 3, 2008 8:55:58 AM
                        > > > > Subject: [ydn-javascript] DDProxy doesn't respond on first click
                        > > > with DataTable
                        > > > >
                        > > > > DDProxy doesn't respond on first click with DataTable Hi, I'm
                        > > > trying to drag and drop rows from a DataTable. The
                        > > > > rowMousedownEvent is fired when I click on a row, but the proxy
                        > isn't
                        > > > > created. It's only created on the second click for any given
                        > row. Any
                        > > > > ideas? Code:
                        > > > > (function() {
                        > > > > var Dom = YAHOO.util.Dom,
                        > > > > Event = YAHOO.util.Event
                        > > > >
                        > > > > var myColumnDefs = [
                        > > > > {key:"table",label:"Table",sortable:true},
                        > > > > {key:"item",label:"Item",sortable:true},
                        > > > > ];
                        > > > >
                        > > > > // Grab table data from existing markup
                        > > > > myDataSource = new
                        > > YAHOO.util.DataSource(YAHOO.util.Dom.get("table1"));
                        > > > > myDataSource.responseType =
                        > YAHOO.util.DataSource.TYPE_HTMLTABLE;
                        > > > > myDataSource.responseSchema = {
                        > > > > fields: [{key:"table"},{key:"item"},]
                        > > > > };
                        > > > >
                        > > > > // Instantiate datatable with parsed markup (applies Sam
                        theme)
                        > > > > myDataTable = new YAHOO.widget.DataTable("workarea1",
                        > > myColumnDefs,
                        > > > > myDataSource, {
                        > > > > sortedBy:{key:"table",dir:"desc"},
                        > > > > selectionMode:"single"
                        > > > > });
                        > > > >
                        > > > > // Execute drag-and-drop code on mousedown
                        > > > > myDataTable.subscribe("rowMousedownEvent", function(ev) {
                        > > > > var rowElement =
                        > > myDataTable.getTrEl(Event.getTarget(ev));
                        > > > >
                        > > > > // Create a proxy for showing the row being dragged
                        > > > > var ddRow = new YAHOO.util.DDProxy(rowElement.id);
                        > > > >
                        > > > > // Highlight row selected for dragging
                        > > > > ddRow.onMouseDown = function(ev) {
                        > > > > myDataTable.highlightRow(rowElement);
                        > > > > };
                        > > > >
                        > > > > ddRow.onMouseUp = function(ev) {
                        > > > > myDataTable.unhighlightRow(rowElement);
                        > > > > };
                        > > > >
                        > > > > });
                        > > > >
                        > > > > var myLogReader = new YAHOO.widget.LogReader();
                        > > > > })();
                        > > > >
                        > > >
                        > > >
                        > > >
                        > > > ------------------------------------
                        > > >
                        > > > Yahoo! Groups Links
                        > > >
                        > >
                        > >
                        > >
                        > > ------------------------------------
                        > >
                        > > Yahoo! Groups Links
                        > >
                        >
                        >
                        >
                        > ------------------------------------
                        >
                        > Yahoo! Groups Links
                        >



                        ------------------------------------

                        Yahoo! Groups Links
                      Your message has been successfully submitted and would be delivered to recipients shortly.