grid select 에서 dindex 때문인지
tree로 접혀있을때 하위 리스트를 클릭하면 그 dindex의 info를 활용하네요
예를 들어
1,2가 묶여서있고
3,4가 묶여서
1,2 트리
3,4 트리가 있는데
접혀있을때 리스트를 보면
1
3
으로 되어있는데
3을 누르면 dindex 2여서 2의 데이터로 나오네요…
제가 잘못한건지… 해결방법을 도저히 모르겠습니다 ㅜㅜ
grid select 에서 dindex 때문인지
tree로 접혀있을때 하위 리스트를 클릭하면 그 dindex의 info를 활용하네요
예를 들어
1,2가 묶여서있고
3,4가 묶여서
1,2 트리
3,4 트리가 있는데
접혀있을때 리스트를 보면
1
3
으로 되어있는데
3을 누르면 dindex 2여서 2의 데이터로 나오네요…
제가 잘못한건지… 해결방법을 도저히 모르겠습니다 ㅜㅜ
context menu에서 item을 갖고 오는 코드에서
dindex 번호의 item을 가져오는것을 확인했습니다.
ax5grid.js 파일에서
if (target) {
// item 찾기
rowIndex = Number(target.getAttribute("data-ax5grid-column-rowIndex"));
colIndex = Number(target.getAttribute("data-ax5grid-column-colIndex"));
dindex = Number(target.getAttribute("data-ax5grid-data-index"));
doindex = Number(target.getAttribute("data-ax5grid-data-o-index"));
column = self.bodyRowMap[rowIndex + "_" + colIndex];
item = self.list[doindex];
// item = self.list[dindex]; tree 구조 때문에 doindex로 수정
}
doindex로 수정하여 해결했습니다.
혹시나 누군가 다른 검색을 통해 정보를 얻고싶어 할 수 있으니 남깁니다.
body에 onDataChanged에서 접혔을때 해당 줄의 데이터를 잘못 가져올 경우
ax5grid.js에서
if (this.onDataChanged) {
this.onDataChanged.call({
self: this,
list: this.list,
dindex: _dindex,
doindex: _doindex,
item: this.list[_dindex],
key: _key,
value: _value
});
}
부분의 item: this.list[_dindex] 을
item: this.list[_doindex],
로 변경하여 해결했습니다.