QUERY: Adding more JS/DOM attributes to DataGrids

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dhruba.bandopadhyay

    QUERY: Adding more JS/DOM attributes to DataGrids


    I know that JavaScript lets us add:

    ondragenter, ondragover, ondragleave, ondrop

    events to normal HTML table td tags. This lets us do highlighting of
    table cells/rows, and capture drag & drop events. So to handle
    ondrop we can use JavaScript:

    this.OnDrop = function(obj) {
    obj.parentEleme nt.style.backgr oundColor = "white";
    var strData = window.event.da taTransfer.getD ata("text");
    this.InsertRow( obj.parentEleme nt.rowIndex, strData);
    window.event.ca ncelBubble = true;
    }

    The obj is the object that was dropped onto. So obj.parentEleme nt is
    the tr element, etc. Does all tr elements implicitly have a rowIndex
    member which contains the row number of the table?

    What am wondering is how can one add the ondrop="" attribute to a
    table which was generated from a DataGrid? If it is not possible
    adding JavaScript/DOM attributes to DataGrid's generated tables, then
    is there any way to capture these window.events and knowing exactly
    which DataGrid table row/cell it was dragged onto?

    I was told to look for "DataGrid Overviews" at 4guysfromrolla. com but
    could not find anything about it. Not even google.com could help. Is
    there no drag and dropping support for ASP.NET datasource tables?



    --
    dhruba.bandopad hyay
    ------------------------------------------------------------------------
    Posted via http://www.codecomments.com
    ------------------------------------------------------------------------

Working...