不想说了,直接上代码
$(document).ready(function () {
$("#item").combotree({
url: '../../Handler/DetectLine/GetDetStaTreeDataHandler.ashx',
valueField: 'id',
textField: 'text',
editable: true,
keyHandler: {
enter: function () {
var q = $('#item).combotree('getText');
var t = $(this).combotree('tree');
var nodes = t.tree('getChildren');
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
if (node.text.indexOf(q) >= 0) {
$(node.target).show();
} else {
$(node.target).hide();
}
}
var opts = $(this).combotree('options');
if (!opts.hasSetEvents) {
opts.hasSetEvents = true;
var onShowPanel = opts.onShowPanel;
opts.onShowPanel = function () {
var nodes = t.tree('getChildren');
for (var i = 0; i < nodes.length; i++) {
$(nodes[i].target).show();
}
onShowPanel.call(this);
};
$(this).combo('options').onShowPanel = opts.onShowPanel;
}
}
}
});
});