2012-06-04 5 views
0
나는 아래의 코드를 사용하여 노드의 이름을 변경하려고

, 나는 server.aspx하는 노드의 ID 및 새 이름을 통과해야 "이름 바꾸기"는 JSTree 변경 노드의 새 이름을받는 방법

어떻게 내가 페이지를

감사

.bind("rename.jstree", function (e, data) { 
      data.rslt.obj.each(function() { 
       $.ajax({ 
        async: false, 
        type: 'POST', 
        url: "./ajax/server.aspx", 
        data: 
        { 
         "operation": "rename_node", 
         "id": this.id 
        }, 
        success: function (r) { 
         if (r == "-1") { 
          $.jstree.rollback(data.rlbk); 
         } 
         else { 
          $(data.rslt.oc).attr("id", "node_" + r.id); 
          if (data.rslt.cy && $(data.rslt.oc).children("UL").length) { 
           data.inst.refresh(data.inst._get_parent(data.rslt.oc)); 
          } 
         } 
        }  
       }); 
      }); 
     }) 

답변

2
.bind("rename.jstree", function (e, data) { 
     data.rslt.obj.each(function() { 
      $.ajax({ 
       async: false, 
       type: 'GET', 
       url: "./ajax/server.aspx", 
       data: 
       { 
        "operation": "rename", 
        "id": this.id, 
        "new_name" : data.rslt.new_name 
       }, 
       success: function (r) { 
        if (r == "-1") { 
         $.jstree.rollback(data.rlbk); 
        } 
        else { 
         $(data.rslt.oc).attr("id", "node_" + r.id); 
         if (data.rslt.cy && $(data.rslt.oc).children("UL").length) { 
          data.inst.refresh(data.inst._get_parent(data.rslt.oc)); 
         } 
        } 
       }  
      }); 
     }); 

    }) 
을 server.aspx이 두 값을 전달할 수있는 방법 노드

의 새 이름을 얻을

관련 문제