Я хочу проверить узел перед тем, как бросить его на дерево.Я использовал событие beforenodedrop для этой цели, но проверка выполняется на стороне сервера, так как ответ не приходит вовремя, и функция всегда возвращает true, поэтому узел отбрасывается.я хочу знать, какой метод / событие следует использовать для этой цели
Вот мой код для события beforenodedrop
treeList_fnBeforeNodeDrop = function (e){
if(e.target.attributes.LocationLevel<=e.data.node.attributes.LocationLevel)//if node is dropped on node of previous level
{
return true;
}else{ //If node is dropped on level greather than its level like region into area verify its hierarchy
Ext.Ajax.request({
method: 'POST',
url: this.webService + '/ValidateNodeDrop',
params: {DropLocationId: e.data.node.id,ParentLocationId:e.target.id, TargetLocationLevel:e.target.attributes.LocationLevel},
success: function ( result, request ) {
return true;
},
failure: function ( result, request ) {
Ext.Msg.alert('Failure', 'You can not drop node at this level');
return false;
}
});
}
}
Пожалуйста, помогите мне, какую ошибку я сделал