EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: iamjxc on April 20, 2014, 12:30:38 AM



Title: 能否统一 combo 事件模型
Post by: iamjxc on April 20, 2014, 12:30:38 AM
主要是下面的事件:
onBeforeLoad
onLoadSuccess
onLoadError

虽然 combotree 和 combogrid 也有这些事件, 但是下面的代码不能通用
function onBeforeLoad(param){
   var el = $(this);
   var text = el.combo("getText");
   return true;
}

因为 combotree 的 onBeforeLoad 是 tree 的事件, 所以
el.combo("getText"); 会出错

给 combobox 和 combotree 注册同一个 onBeforeLoad 事件, 目前有下面2个问题:
1. 我如何判断当前的 $(this) 到底是 combobox 还是 combotree
2. 我如何得到tree对应的combotree对象