조치 배열을 만들려고합니다. 기본적으로 이들은 다음에 해고 될 함수를 아는 함수 목록입니다. 나는 많은 방법을 시도했지만 안정적으로 작동하도록 할 수는 없습니다. 나는 GUI를하고 그들이 자신의 작업 (파일 선택, 편집 특성 등)Javascript : 링크 된 함수 목록 또는 유사한 방법?
는예 흐름 완료 한 때 콜백 프레임을 팝업이 있어요 :
작업 1 : 열린 FileBrowser (iframe이 브라우징 제어), 선택 , 작업 2를 실행하십시오. 작업 2 : FileBrowser에서 값을 가져오고 iframe FileProperties를 엽니 다. 작업 3을 완료하면 작업 3 : 파일 속성 ID 가져 오기, 페이지 컨트롤에 ID 추가
각 작업은 이전 작업에서 콜백을 대기해야합니다. 나는 이것을하는 방법에 모든 아이디어에 열려있다! 유일한 것은 하드 코딩을 피할 필요가 있도록 단계가 생성 된 서버 측입니다! 아래는 지금까지의 시도입니다!
모든 아이디어에 감사드립니다.
FruitBat는
/* action array */
var actions = new Array();
var data = {};
var op = function(fn, next, data) {
this.op = this;
this.fn = fn;
this.next = next;
this.data = data;
};
function one(myop) {
var op1 = myop;
var url = 'poptarget.aspx?cid=21&data=' + escape('[Id]=[2],[cid]=[3]');
var frame = $().popFrame('UniqueId', { caption: 'Page Item', url: url, width: 'auto', modal: true });
frame.bindEvent("cancelled saved", function(e, d) {
console.log('other');
callback();
});
frame.bindEvent("close", function(e, d) {
console.log('close');
op1.next.fn.call(op1.next);
});
};
function two(myop) {
console.log('woohoo');
};
actions.push(new op(one, two, null));
actions.push(new op(two, null, null));
var start = actions[0];
start.fn.call(start);
console.log(data);`