thomasJang / axisj

javascript UI library
http://axisj.com/
GNU Lesser General Public License v2.1
310 stars 86 forks source link

AXGrid 스크롤바 미출력 및 websocket 데이터 출력시 scrolltop 으로 가는 현상?? #916

Open yasim21c opened 8 years ago

yasim21c commented 8 years ago

<!DOCTYPE html>

``` AXGrid(setData way) - AXISJ var fnObj<%=i%> = { pageStart: function(){ myGrid<%=i%>.setConfig({ targetID : "AXGridTarget<%=i%>", theme : "AXGrid", colHeadAlign: "center", // 헤드의 기본 정렬 값 height:"300", colGroup : [ {key:"Time", label:"시간", width:"135", align:"center"}, {key:"Damdang", label:"담당", width:"135", align:"center"}, {key:"DevName", label:"장비", width:"135", align:"center"}, {key:"DevIP", label:"주소", width:"135", align:"center"}, {key:"Item", label:"항목", width:"135", align:"center"}, {key:"Contents", label:"등급", width:"135", align:"center"}, {key:"Time", label:"내용", width:"135", align:"center"} ], body : { marker: function(){ }, onclick: function(){ //toast.push(Object.toJSON({index:this.index, r:this.r, c:this.c, item:this.item})); //alert(this.list); //alert(this.page); } }, page:{ paging:true, onchange: function(pageNo){ //dialog.push(Object.toJSON(this)); trace(this, pageNo); } } }); //myGrid.setData(gridData); myGrid<%=i%>.setList(listOfUsers, null, "reload", null); myGrid<%=i%>.setList(listOfUsers, null, false, null); //myGrid<%=i%>.setList(listOfUsers); } }; <%}%> jQuery(document.body).ready(function() { var data = new GetAllUsers(); <%for(int i=0;i fnObj<%=i%>.pageStart(); <%}%> });
``` # 소스 코드 일부를 발췌하여 올립니다. 상기 버전의 환경에서 websocket연동하여 테스트중입니다. 1. 상기 코드에서 데이터 출력시 그리드의 가로,세로 스크롤바가 표시되지 않습니다. 2. websocket의 데이터를 setList 하여 추가시 현재 열람하고 있는 위치에서 top으로 위치가 이동되 버립니다. api상에 값을 넣어도 동일한 증상이 발생합니다. 어느 부분을 더 살펴보면 좋을런지요? 수고하세요.
thomasJang commented 8 years ago

setList를 두번 호출 하시는게 조금 이상하구요.

데이터를 소켓으로 받아서 그리드에 추가 하시는 건지 데모 환경에서는 특별한점을 찾지 못했습니다.

yasim21c commented 8 years ago

setList 는 reload, false 두가지 형태로 다 해봤는데 적용이 안되더란 의미로 작성해 본 것입니다. websocket으로 들어온 JSON List를 Grid에 계속 append 하는 것입니다.

thomasJang commented 8 years ago

http://dev.axisj.com/samples/AXGrid/inline-edit.html 에서 추가하기를 눌러보세요. 원하시는 건 이렇게 하는 것 같습니다.

yasim21c commented 8 years ago

참고하겠습니다. 그럼 수고하세요.