EH.dragOperation was the key to success :-)
What I was trying to do is show the specific column header (or something which closely resembles it) as a drag tracker while repositioning columns.
I don't want to affect the drag behavior while resizing columns - only for repositioning!
This is actually what I would have expected to happen is I set the dragAppearance to "target", but because that didn't work, I reverted to implementing a custom tracker.
For reference here is an example which demonstrates my solution:
Code:
isc.ListGrid.create({ ID: "countryList", width:500, height:224, alternateRecordStyles:true, data: countryData, fields:[ {name:"countryCode", title:"Flag", width:40, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png"}, {name:"countryName", title:"Country"}, {name:"capital", title:"Capital"}, {name:"continent", title:"Continent"} ], canResizeFields: true, headerButtonProperties: { dragAppearance: "tracker", setDragTracker: function() { if (isc.EH.dragOperation == "dragReorder") isc.EventHandler.setDragTracker( `<div class="${this.baseStyle}" style="width:${this.width}px; height:${this.height}px; line-height:${this.height}px;">${this.title}</div>` ); else isc.EventHandler.setDragTracker(""); return false; } } })
Gil
Leave a comment: