안녕하세요 그레이프시티입니다.
1. designer binding 사용시에 json designerBindingPath 를 사용하고 있는데 혹시 해당 스키마를 코드레벨에서 생성할 수 있는 메소드나 방법이 있을까요 ?
아래 샘플과 같이 필드 리스트를 코드 레벨에서 생성하고 디자이너 컴포넌트에 적용할 수 있습니다.
필드 리스트는 해당 샘플의 sampleData를 참고해 주시기 바랍니다.
window.onload = function () {
var designer = new GC.Spread.Sheets.Designer.Designer(document.getElementById("gc-designer-container"));
var spread = designer.getWorkbook();
var sheet = spread.getSheet(0);
designer.setData("treeNodeFromJson", JSON.stringify(sampleData));
}
var sampleData = {
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"textfield": {
"dataFieldType": "text",
"type": "string"
},
"checkboxfield": {
"dataFieldType": "checkbox",
"type": "string"
},
"hyperlinkfield": {
"dataFieldType": "hyperlink",
"type": "string"
},
"comboboxfield": {
"dataFieldType": "combox",
"type": "string"
},
"buttonfield": {
"dataFieldType": "button",
"type": "string"
},
"tablefield": {
"dataFieldType": "table",
"type": "array",
"items": {
"type": "object",
"properties": {
"text1_table": {
"dataFieldType": "text",
"type": "string"
},
"text2_table": {
"dataFieldType": "text",
"type": "string"
}
}
}
}
},
"type": "object"
}
2. table.bind() 시 셀이 병합되어 있으면 실행이 안되는데 따로 설정해줘야 할 것이 있을까요 ?
병합이 되어 있더라도 표의 열은 앞에서부터 순서대로 바인딩되기 때문에 병합되어 보이지 않는 셀에는 빈 TableColumn을 설정해서 순서를 맞춰주어야 합니다.
아래 샘플을 참고해 주시기 바랍니다.
3. 필드를 드래그해서 바인딩 시에 showHeader 를 false로 지정해서 표를 바인딩 할 때 헤더가 보이지 않게 할 수 있을까요 ?
아쉽게도 표가 생성될 때 헤더 없이 생성할 수는 없습니다.
우선 생성 후, 헤더를 제거하는 방식으로 진행해 주셔야 합니다.
감사합니다.
그레이프시티 드림