|
发表于 2014-1-5 23:11:27
|
显示全部楼层
目前自己是在onBeforeSelect 事件写验证方法,希望高手有更好的方法贴出共享一下
$('#gsParentid').combotree({
url : "",
panelHeight: 200,
width: 170,
onBeforeSelect : function(node){
validResult = false;
var validMessage = "";
var validData = new Object();
validData["gsParentId"] = node.id;
validData["gsId"] = $("#id").val();
$.ajax({
type: "get",
url: "venGoodsSortController.do?verifyParentId",
datatype: "json",
data: validData,
cache: false,
success: function(data) {
validResult = data["action"];
validMessage = data["message"];
},
async: false
});
var obj = $("#gsParentid").parent().find(".Validform_checktip");
if(validResult) {
obj.text(validMessage);
obj.removeClass("Validform_wrong");
obj.addClass("Validform_right");
}
else {
obj.text(validMessage);
obj.removeClass("Validform_right");
obj.addClass("Validform_wrong");
}
obj.show();
return true;
}
});
|
|