/** * DataTable for JavaScript Data Editing * jQuery Plugin * * jQuery 1.4 or higher * jQueryUI 1.8 or higher * * @version 1.0 * @author bitofsky@neowiz.com 2012.07.13 * @encoding UTF-8 */ // http://glat.info/jscheck/ /*global $, jQuery, confirm, console, alert, JSON */ // 명료한 Javascript 문법을 사용 한다. "use strict"; (function($, window, document){ var DEFAULT_OPTION = { /** * @var {boolean} option.modifier=false 데이터 수정 모드 활성화 여부 */ 'modifier' : false, /** * @var {array} option.showPath=[] 보여줄 데이터 경로 명시. 명시된 경로의 데이터 노출. */ 'showPath' : [], /** * @var {array} option.hidePath=[] 보여주지 않을 데이터 경로 명시. 명시된 경로의 데이터 미노출 */ 'hidePath' : [], /** * @var {string} option.editEvent='dblclick' 셀 에디터 이벤트 설정 */ 'editEvent' : 'dblclick', /** * @var {array} option.editAllowPath=[] 수정할 데이터 경로 명시. 명시된 경로의 데이터에만 수정 기능이 동작. */ 'editAllowPath': [], /** * @var {array} option.editDenyPath=[] 수정을 금지할 데이터 경로 명시. 명시된 경로의 데이터에는 수정 기능이 미동작. */ 'editDenyPath' : [], /** * @var {plainObject} option.pathName={} 경로의 노출 이름을 명시. Key=경로, Value=이름 */ 'pathName' : {}, /** * @var {number} option.depth=0 몇 depth 까지 기본 노출할지에 대한 설정. 0은 모두 노출 */ 'depth' : 0, /** * @var {string} option.expandLabel='Detail' */ 'expandLabel' : 'Detail', /** * @var {string} option.title=null 테이블 상단 제목 caption */ 'title' : null, /** * @var {boolean} option.keyEdit=false Object/Array 의 서브키를 추가 또는 삭제하는 기능 사용 여부 */ 'keyEdit' : false, /** * @var {boolean} option.html=true String 값으로 들어온 태그를 HTML 로 사용할지 그냥 태그 자체를 보여줄지 설정 */ 'html' : true, /** * @var {boolean} option.allowElement 데이터 중 Element 가 있는 경우 처리 방법. true=append(), false=toString() */ 'allowElement' : false, 'css' : { 'table' : { 'border-collapse': 'separate', 'border-spacing' : '5px 0', 'width' : '100%' }, 'key' : { 'padding' : '0 5px 0 5px', 'vertical-align' : 'top', 'text-align' : 'right', 'width' : '1px', 'white-space' : 'nowrap' } } }; var TAG = { table : '', thead : '', tbody : '', tr : '', td : '
', div : '
', text : '', textarea : '