onDrop(args) { console.log(this.listObj.dataSource); }
…
<ListBoxComponent ref={(scope) => { this.listObj = scope; }} dataSource={this.data} fields={this.fields} allowDragAndDrop={true} drop={this.onDrop.bind(this)}/>
|
onBeforeDrop(args) {
var category = this.listObj.getDataByValue(args.target.getAttribute('data-value')).Category;
var droppedItem = this.listObj.getDataByValue(args.droppedElement.getAttribute('data-value')).Category;
if ((category != droppedItem)) {
args.cancel = true;
}
} |