라디오 버튼을 동적으로 생성하기 위해 만들었던 jQuery인데...
DWR과 같이 사용을 한터라.... 범용으로 사용하기에는 무리가 있을 수 있다.
DWR과 같이 사용을 한터라.... 범용으로 사용하기에는 무리가 있을 수 있다.
음...데이터 형태만 맞추면 가능할지도....^^;;
/************************************************************************************
' function명: addRadioMap
' 내용 : 라디오버튼 동적으로 생성.
' jQuery.js(core)에 삽입
' strGrpName = 라디오버튼 그룹명.
' data = [{key:'string', value:'string'},{key:'string', value:'string'},{key:'string', value:'string'}] 형식
' strKey = Map데이터의 key
' strValueKey = Map데이터의 value key
*************************************************************************************/
addRadioMap: function ( strGrpName, data, strKey, strValueKey ) {
var arrText = [];
for( var iCnt in data ){
arrText[iCnt] = " <input type='radio' name='"+strGrpName
+"' id='"+data[iCnt][strKey]+"'value='"+data[iCnt][strValueKey]+"'>"+data[iCnt][strValueKey];
}
// 해당 테그의 압쪽에 넣는다.
this.prepend(arrText.join(' ')); //or this.html(arrText.join(''));
}