Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

트리 클릭시 Cannot read property '__selected__' of undefined #155

Open
tpayGhs opened this issue Mar 12, 2020 · 1 comment
Open

트리 클릭시 Cannot read property '__selected__' of undefined #155

tpayGhs opened this issue Mar 12, 2020 · 1 comment

Comments

@tpayGhs
Copy link

tpayGhs commented Mar 12, 2020

아래와 같이 트리를 생성했는데
Cannot read property 'selected' of undefined -> ax5grid.js:1972
에러가 납니다. 원인이 뭘까요

this.target = axboot.gridBuilder({
target: $('[data-ax5grid="grid-view-02"]'),
showLineNumber: true,
showRowSelector: true,
header: {align:'center'},
frozenColumnIndex: 3,
frozenRowIndex: 2,
columns: [
{
key: "id",
label: "ID",
width: 80,
styleClass: function () {
return "ABC";
},
enableFilter: true,
align: "center",
editor: {
type: "text", disabled: function () {
// item, value
return false;
}
}
},
{key: "name", label: "Name", align: "left", width: 200, treeControl: true},
{
key: "isChecked", label: "Checkbox", width: 50, sortable: false, align: "center", editor: {
type: "checkbox", config: {height: 17, trueValue: "Y", falseValue: "N"}
}
}
],
body: {
columnHeight: 26,
onDataChanged: function () {
if (this.key == 'isChecked') {
this.self.updateChildRows(this.dindex, {isChecked: this.item.isChecked});
}
else if(this.key == 'selected'){
this.self.updateChildRows(this.dindex, {selected: this.item.selected});
}
}
},
tree: {
use: true,
indentWidth: 10,
arrowWidth: 15,
iconWidth: 18,
icons: {
openedArrow: '',
collapsedArrow: '',
groupIcon: '',
collapsedGroupIcon: '',
itemIcon: ''
},
columnKeys: {
parentKey: "pid",
selfKey: "id"
}
}
});

@mayoYcat
Copy link

동일한 이슈가 있었는데, 혹시 필요한 분 계실까봐 제가 수정한 내용 답변 남깁니다.
ax5grid.js 파일에서 수정했습니다.

var doi = this.proxyList[di].__original_index__; 이부분 확인하시면 됩니다.

( 변경전)
while (di--) { if (this.list[doi][cfg.columnKeys.selected]) { pi = this.$.livePanelKeys.length; while (pi--) { this.$.panel[this.$.livePanelKeys[pi]].find('[data-ax5grid-tr-data-index="' + di + '"]').attr("data-ax5grid-selected", false); } } this.proxyList[di][cfg.columnKeys.selected] = false; var doi = this.proxyList[di].__original_index__; }

(변경후)
while (di--) { var doi = this.proxyList[di].__origin_index__; if (this.list[doi][cfg.columnKeys.selected]) { pi = this.$.livePanelKeys.length; while (pi--) { this.$.panel[this.$.livePanelKeys[pi]].find('[data-ax5grid-tr-data-index="' + di + '"]').attr("data-ax5grid-selected", false); } } this.proxyList[di][cfg.columnKeys.selected] = false; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants