2011-05-06 2 views
0

내가 콜백이 실행되지 없구요 다음과 같습니다 코드의 라인을 가지고있어 발사하지!JQuery와 콜백

건배 Shotemba 여기

전체 코드 :

함수 GroupRepository() { }

GroupRepository.Add = 함수 (targetSelection, oGroup, addToPage) {

var tableToInsert = null; 

var nGroupID = oGroup.nScopeOfWorkGroupID; 
var sDescription = oGroup.sScopeOfWorkGroupDescription; 


Eclipse3.GroupService.InsertGroup(Globals.N_JOB_ID, oGroup, InsertGroup_Success, InsertGroup_Error); 

function InsertGroup_Success(response) { 
    nGroupID = parseInt(response.nIdentity); 
    var bConcurrencyId = response.bNewConcurrencyId; 

    //If this entry contains rows pull those rows out, 
    var rows = tableToInsert.find("tbody tr"); 
    tableToInsert.remove(); 

    oGroup.nScopeOfWorkGroupID = nGroupID; 
    oGroup.bConcurrencyId = bConcurrencyId; 

    var newGroupElement = addToPage(oGroup); 

    //add to the new group being created, 
    newGroupElement.find("tbody").append(rows); 


    //Globals.DisplayMessage("Insert Succeeded", "Your attempt to add a new record was successful."); 
    Globals.DisplayMessage("Insert Group Succeeded", "A new record was added."); 

    return this; 
}; 

function InsertGroup_Error(error) { 

    Globals.HandleError("Item Group Failed", error); 
}; 

}

+0

"GroupRepository는"무엇 콜백을 확장하려면 새 함수를 선언? 제발, 우리에게 더 많은 코드를주세요. 또는 http://jsfiddle.net – reporter

+0

이 GroupRepository는 무엇입니까? – vinothkr

+0

@vinothkr을 되찾기위한 대가, 전체 코드는 다음과 같습니다. – santosh

답변

0

GroupRepository.Add에는 targetSelection, oGroup 및 addToPage 매개 변수가 3 개뿐입니다. 다음

function newCallBack(param) { 
    var result = oSow.AddGroupToPage(param); 
    alert(123); 
    return(result); 
} 

과 :

GroupRepository.Add("#divSortingArea", oGroup, newCallBack); 
+0

안녕하세요, @ariel, function() {alert (123); } oSow.AddGroupToPage가 호출 된 후에 실행되도록, 이전에 function() {alert (123)에 대한 placehoder를 추가했습니다. } GroupRepository.Add ("# divSortingArea", oGroup, oSow.AddGroupToPage, fn) 내부; 그러나 그것도 작동하지 않았다. – santosh

+0

edited ... 두 명령어 모두 – ariel

+0

안녕하세요 @arial로 새 함수를 만들어야하거나 더 간단한 방법이 있습니다. InsertGroup_Success 핸들러에서 nGroupID = parseInt (response.nIdentity)를 호출자에게 반환해야합니다. – santosh