[BUG]drop method of the datasourcedroptarget doesn't work properly if the target datasource is empty

Last post 04-22-2006 9:13 AM by Luis Abreu. 0 replies.

Sort Posts:

  • [BUG]drop method of the datasourcedroptarget doesn't work properly if the target datasource is empty

    04-22-2006, 9:13 AM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs

    hello guys.

    though i may be wrong, i believe that there's a bug on the way the drop method of the DataSourceDropTarget class is implemented. the problem happens when you are trying to drag an item from a listview to another and the associated datasource control is empty. currently, the method has the follwogin code (i'm putting here only the relevant portion):

    this

    .drop = function(dragMode, type, data) {
      if (data) {
          var p;
          var target = _target ? _target : this.control;
          if (_append) {
             p = target["get_" + _property];
             if (p) {
                var targetData = p();
                if (targetData) {
                   targetData.add(data);
               }
              else {
                 p = target["set_" + _property];
                if (p) {
                   p.call(target, data);
                }

    ...

    well the problem happens on the bold line. this doesn't work because the set_data property expects to receive an array or a datatable and data will normally hold an instance of an element shown on the listview that represented the origin of the drag operation.

    i think that the previous line should be:

     p.call(target, [data]);

    I guess that iw ould be really usedull to get feedback on this errors because I've been seeing several posts about bugs (in fact, i've reported a few in these last days) and no feedback has been provided.

    thanks.

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
Page 1 of 1 (1 items)