0
다른 방법으로 데이터를로드 할 수있는 플러그인이 있습니다. 나는 현재 올바른 기능을 실행하기 위해 플래그와 if
을 사용하고 있습니다. 대신 어떻게 함수 포인터를 사용할 수 있는지 알아 내려고하고있다.다른 기능을 사용하여 데이터로드
$.fn.shureTable = function(options) {
var defaults = {
loadMethod: populateFromArray
};
return this.each(function() {
var $this = $(this);
function loadJson(json) {
if (json.appendMode == 0)
jQuery('tbody', $this).empty();
options.loadMethod(json.Rows);
}
function populateFromArray(rowArray){
}
}
}
나는 오류가 populateFromArray가 정의되지 않은 것을 말하는 얻을 : 여기
은 조각이다.options
을 사용하여 사용할 기능을 어떻게 제어 할 수 있습니까?