fixed event handling in tree, added tree specific onSelect and onCheck events, implemented !multiple mode and fixed dhtmlxtree to not trigger onSelect if selection is change via set_value (according to their documentation)

This commit is contained in:
Ralf Becker
2013-02-08 13:23:58 +00:00
parent 6de7ab7faf
commit 763279562c
3 changed files with 68 additions and 31 deletions

View File

@@ -1226,17 +1226,19 @@ SELECTION
/**
* @desc: visual select item in tree
* @type: private
* @param: node - tree item object
* @param: node - tree item object
* @param: mode - true suppress onSelect
* @edition: Professional
* @topic: 0
*/
dhtmlXTreeObject.prototype._selectItem=function(node,e){
if (this.checkEvent("onSelect")) this._onSSCFold=this.getSelectedItemId();
dhtmlXTreeObject.prototype._selectItem=function(node,e,mode){
if (typeof mode == 'undefined') mode=false;
if (!mode && this.checkEvent("onSelect")) this._onSSCFold=this.getSelectedItemId();
this._unselectItems();
this._markItem(node);
if (this.checkEvent("onSelect")) {
if (!mode && this.checkEvent("onSelect")) {
var z=this.getSelectedItemId();
if (z!=this._onSSCFold)
this.callEvent("onSelect",[z]);
@@ -1329,7 +1331,7 @@ SELECTION
var lastId=that.getSelectedItemId();
if ((!e)||(!e.skipUnSel))
that._selectItem(obj,e);
that._selectItem(obj,e,mode);
if (!mode) {
if (obj.actionHandler) obj.actionHandler(obj.id,lastId);