2015.03.13-js can pass the callback method as a parameter in order to ensure the execution order when calling a method. The conflict between omTree and omDialog styles is resolved.

Today's tasks:
1. Add and delete enterprise employees, add and delete departments.


Actual :
complete the main functions, except delete departments.


Gain
1. For asynchronously loaded components in js, if you need to do something after the loading is completed, you can consider using callbacks The way is
  to expand the specified node and its parent node after the omTree is loaded, and select the current node
  var refreshCurr = function()
  {
      var parent_node = $("#mytree").omTree('findNode', 'id', submitData.Parent_Dept_ID);	
      var node = $("#mytree").omTree('findNode', 'text', curr_selected_deptName);	
      $("#mytree").omTree('expand', parent_node);
      $("#mytree").omTree('expand', node);      
	 
      $("#mytree").omTree('select', node);      
  }
 
  getOrganization(refreshCurr);

  var  getOrganization = function(callback){
	$.ajax({
	     .....
	     success: function(msg){
                 .....
                 if (callback != undefined)
                 {
		      callback(); // execute callback
		 }
	     }
    	});
  }


2. When it is found that the omTree style in the dialog is disordered, the method is to open the debug mode, compare the original one with the one in the window, mainly compare the calculated style, and find the difference; then find out whether the style is changed by the parent class. Or the high-level ones are covered, and finally the extra style is OK.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327033763&siteId=291194637