게시판을 이용해 주셔서 감사합니다.
다음양식에 맞게 입력해주세요.
* 고객시스템명 : 대전도시공사
* 문의할 Component명 및 버전 :
* DataSet 버전 : 1,2,1,71 - MxDataSet
* Tr 버전 :
* 문의 유형(질문/요청/참조) : Mgrid 사용 문제
* 내용 :
데이터 셋에 Mgrid를 연결후 데이터셋의 CountRow를 하면 데이터가 조회 됀 갯수를 뿌려주는데
Mgrid에는 데이터가 올라 오지 않고 헤더만보여 줍니다. 클래스 명도 맞게 기술 한거 갖고
캡 파일 버젼 도 확인 하고 했는데 문제가 없는듯 한대 ... 왜 않돼는지요 ㅠㅠ
하단에 현재 사용 하고 있는 MXGrid ClassID 와 MXMgrid ClassID
Mgrid View 하는 부분, 그리고 공통 스크립트로 Mgrid 를 초기화 해서
데이터 셋과 연결( agrid.DataID = dataset.id ) 하는 부분을 첨부 했으니
참조 하여 주시기 바랍니다.
[ class ID ]
데이터셋 {2506B38B-0FF7-4249-BA3E-8BC1DC399FBB}
Mgrid {8B6E903C-6297-44FB-B6C5-4F9D7FCA2A08}
[ View - jsp 파일]
String GH_Line_1 = "top="0" bottom="20" ";
String GH_Line_2 = "top="20" bottom="40" ";
String GH_Line_3 = "top="0" bottom="40" ";
String GV_Line_1 = "top="0" bottom="20" ";
String GV_Line_2 = "top="20" bottom="40" ";
String GV_Line_3 = "top="0" bottom="40" ";
int G_Pos = 0;
int G_Idx = 0;
<object id=gridMGRID classid="clsid:8B6E903C-6297-44FB-B6C5-4F9D7FCA2A08" width=100% height=100%>
<Param Name="ColumnInfo" value='
<COLUMNINFO>
<COLUMN id="id_명칭" refcolid="명칭" index="<%=++G_Idx%>">
<TREE type="2" levelcolumn="레벨" expand="false"/>
<HEADER <%=GH_Line_3%> left="<%=G_Pos%>" right="<%=G_Pos+260%>" text="명칭"/>
<VIEW <%=GV_Line_3%> left="<%=G_Pos%>" right="<%=G_Pos+260%>" align="leftcenter"/>
<CHILD type="edit" ime="0"/>
</COLUMN>
<COLUMN id="id_규격" refcolid="규격" index="<%=++G_Idx%>">
<HEADER <%=GH_Line_3%> left="<%=G_Pos+260%>" right="<%=G_Pos+330%>" text="규격"/>
<VIEW <%=GV_Line_3%> left="<%=G_Pos+260%>" right="<%=G_Pos+330%>"/>
<CHILD type="edit" ime="0"/>
</COLUMN>
<COLUMN id="id_단위" refcolid="단위" index="<%=++G_Idx%>">
<HEADER <%=GH_Line_3%> left="<%=G_Pos+330%>" right="<%=G_Pos+400%>" text="단위"/>
<VIEW <%=GV_Line_3%> left="<%=G_Pos+330%>" right="<%=G_Pos+400%>" align="leftcenter"/>
<CHILD type="edit" ime="0"/>
</COLUMN>
<COLUMN id="id_수량" refcolid="수량" index="<%=++G_Idx%>">
<HEADER <%=GH_Line_3%> left="<%=G_Pos+400%>" right="<%=G_Pos+470%>" text="수량"/>
<VIEW <%=GV_Line_3%> left="<%=G_Pos+400%>" right="<%=G_Pos+470%>" align="leftcenter"/>
<CHILD type="edit" ime="0"/>
</COLUMN>
<COLUMN id="id_총합계" view="false">
<HEADER <%=GH_Line_1%> left="<%=G_Pos+470%>" right="<%=G_Pos+610%>" text="합계"/>
</COLUMN>
<COLUMN id="id_단가합계" refcolid="단가합계" index="<%=++G_Idx%>">
<HEADER <%=GH_Line_2%> left="<%=G_Pos+470%>" right="<%=G_Pos+540%>" text="단가"/>
<VIEW <%=GV_Line_2%> left="<%=G_Pos+470%>" right="<%=G_Pos+540%>"/>
<CHILD type="edit" ime="0"/>
</COLUMN>
<COLUMN id="id_합계" refcolid="합계" index="<%=++G_Idx%>">
<HEADER <%=GH_Line_2%> left="<%=G_Pos+540%>" right="<%=G_Pos+610%>" text="금액"/>
<VIEW <%=GV_Line_2%> left="<%=G_Pos+540%>" right="<%=G_Pos+610%>" align="leftcenter"/>
<CHILD type="edit" ime="0"/>
</COLUMN>
<COLUMN id="id_재료비합계" view="false">
<HEADER <%=GH_Line_1%> left="<%=G_Pos+610%>" right="<%=G_Pos+750%>" text="재료비"/>
</COLUMN>
<COLUMN id="id_재료비단가" refcolid="재료비단가" index="<%=++G_Idx%>">
<HEADER <%=GH_Line_2%> left="<%=G_Pos+610%>" right="<%=G_Pos+680%>" text="단가"/>
<VIEW <%=GV_Line_2%> left="<%=G_Pos+610%>" right="<%=G_Pos+680%>" align="leftcenter"/>
<CHILD type="edit" ime="0"/>
</COLUMN>
<COLUMN id="id_재료비" refcolid="재료비" index="<%=++G_Idx%>">
<HEADER <%=GH_Line_2%> left="<%=G_Pos+680%>" right="<%=G_Pos+750%>" text="금액"/>
<VIEW <%=GV_Line_2%> left="<%=G_Pos+680%>" right="<%=G_Pos+750%>"/>
<CHILD type="edit" ime="0"/>
</COLUMN>
<COLUMN id="id_노무비합계" view="false">
<HEADER <%=GH_Line_1%> left="<%=G_Pos+750%>" right="<%=G_Pos+890%>" text="노무비"/>
</COLUMN>
<COLUMN id="id_노무비단가" refcolid="노무비단가" index="<%=++G_Idx%>">
<HEADER <%=GH_Line_2%> left="<%=G_Pos+750%>" right="<%=G_Pos+820%>" text="단가"/>
<VIEW <%=GV_Line_2%> left="<%=G_Pos+750%>" right="<%=G_Pos+820%>" align="leftcenter"/>
<CHILD type="edit" ime="0"/>
</COLUMN>
<COLUMN id="id_노무비" refcolid="노무비" index="<%=++G_Idx%>">
<HEADER <%=GH_Line_2%> left="<%=G_Pos+820%>" right="<%=G_Pos+890%>" text="금액"/>
<VIEW <%=GV_Line_2%> left="<%=G_Pos+820%>" right="<%=G_Pos+890%>" align="leftcenter"/>
<CHILD type="edit" ime="0"/>
</COLUMN>
<COLUMN id="id_경비합계" view="false">
<HEADER <%=GH_Line_1%> left="<%=G_Pos+890%>" right="<%=G_Pos+1030%>" text="경비"/>
</COLUMN>
<COLUMN id="id_경비단가" refcolid="경비단가" index="<%=++G_Idx%>">
<HEADER <%=GH_Line_2%> left="<%=G_Pos+890%>" right="<%=G_Pos+960%>" text="단가"/>
<VIEW <%=GV_Line_2%> left="<%=G_Pos+890%>" right="<%=G_Pos+960%>"/>
<CHILD type="edit" ime="0"/>
</COLUMN>
<COLUMN id="id_경비" refcolid="경비" index="<%=++G_Idx%>">
<HEADER <%=GH_Line_2%> left="<%=G_Pos+960%>" right="<%=G_Pos+1030%>" text="금액"/>
<VIEW <%=GV_Line_2%> left="<%=G_Pos+960%>" right="<%=G_Pos+1030%>" lign="leftcenter"/>
<CHILD type="edit" ime="0"/>
</COLUMN>
<COLUMN id="id_비고" refcolid="비고" index="<%=++G_Idx%>">
<HEADER <%=GH_Line_3%> left="<%=G_Pos+1030%>" right="<%=G_Pos+1290%>" text="비고"/>
<VIEW <%=GV_Line_3%> left="<%=G_Pos+1030%>" right="<%=G_Pos+1290%>"align="leftcenter"/>
<CHILD type="edit" ime="0"/>
</COLUMN>
<COLUMN id="id_제요율적용여부" refcolid="제요율적용여부" index="<%=++G_Idx%>">
<HEADER <%=GH_Line_3%> left="<%=G_Pos+1290%>" right="<%=G_Pos+1360%>" text="제요율적용"/>
<VIEW <%=GV_Line_3%> left="<%=G_Pos+1290%>" right="<%=G_Pos+1360%>"/>
<CHILD type="edit" ime="0"/>
</COLUMN>
<COLUMN id="id_순번" refcolid="순번" index="<%=++G_Idx%>">
<HEADER <%=GH_Line_3%> left="<%=G_Pos+1360%>" right="<%=G_Pos+1430%>" text="순번"/>
<VIEW <%=GV_Line_3%> left="<%=G_Pos+1360%>" right="<%=G_Pos+1430%>"/>
<CHILD type="edit" ime="0"/>
</COLUMN>
</COLUMNINFO>
'>
</object>
[ 공통 스크립트 ]
// Grid 공통 초기화
function G_GridInitM(grid)
{
if (grid == null)
{
C_msgOk("Grid 공통 초기화 에러 : " + G_MSG_GRID_NULL, "에러");
return false;
}
try
{
// !!Grid 공통 초기화 추가!!
grid.DragDrop = 0;
grid.Draw = true;
grid.Enable = true;
grid.EnableDblClkAtNotEditable = false;
grid.FixHScroll = false;
grid.FixVScroll = false;
grid.FocusRect = false;
grid.IME = 0;
grid.Resize = 1;
grid.Sort = true;
grid.ViewHeader = true;
}
catch (e)
{
C_msgOk("Grid 공통 초기화 설정 에러 : " + e.message, "에러");
return false;
}
return true;
}
// DataSet 등록
function G_addDataSetM(aDataset, aTrans, aGrid, aServiceURL, aDataSetTitle)
{
if (aDataset == null)
{
C_msgOk("DataSet 등록 에러 : " + G_MSG_DATASET_NULL, "에러");
return false;
}
try
{
var objDataSetInfo = new G_DataSetInfoM(aDataset, aTrans, aGrid, aServiceURL, aDataSetTitle);
if (G_arrDataSets == null) G_arrDataSets = new Array();
G_arrDataSets.push(objDataSetInfo);
}
catch (e)
{
C_msgOk("DataSet 등록 에러 : " + e.message, "에러");
return false;
}
try
{
G_DataSetInit(aDataset);
// DataSet 관련 이벤트
aDataset.attachEvent ("OnRowInserted", new Function("row", "G_OnRowInserted(" + aDataset.id + ", row);"));
aDataset.attachEvent ("OnRowDeleted", new Function("row", "G_OnRowDeleted(" + aDataset.id + ", row);"));
aDataset.attachEvent ("OnDataError", new Function("row", "colid", "G_OnDataError(" + aDataset.id + ", row, colid);"));
aDataset.attachEvent ("CanRowPosChange", new Function("row", "return G_CanRowPosChange(" + aDataset.id + ", row);"));
aDataset.attachEvent ("OnRowPosChanged", new Function("row", "G_OnRowPosChanged(" + aDataset.id + ", row);"));
aDataset.attachEvent ("OnColumnChanged", new Function("row", "colid", "G_OnColumnChanged(" + aDataset.id + ", row, colid);"));
aDataset.attachEvent ("OnLoadStarted", new Function("G_OnLoadStarted(" + aDataset.id + ");"));
aDataset.attachEvent ("OnLoadCompleted", new Function("rowcnt", "G_OnLoadCompleted(" + aDataset.id + ", rowcnt);"));
aDataset.attachEvent ("OnLoadError", new Function("G_OnLoadError(" + aDataset.id + ");"));
aDataset.attachEvent ("OnLoadProcess", new Function("rowcnt", "G_OnLoadProcess(" + aDataset.id + ", rowcnt);"));
aDataset.attachEvent ("OnFilter", new Function("row", "return G_OnFilter(" + aDataset.id + ", row);"));
aDataset.attachEvent ("OnLayoutChanged", new Function("colcnt", "G_OnLayoutChanged(" + aDataset.id + ", colcnt);"));
aDataset.attachEvent ("OnRowsetChanged", new Function("G_OnRowsetChanged(" + aDataset.id + ");"));
}
catch (e)
{
C_msgOk("DataSet 초기화 에러 : " + e.message, "에러");
return false;
}
try
{
if (aTrans != null)
{
G_TransInit(aTrans);
// Transaction 관련 이벤트
aTrans.attachEvent ("OnSuccess", new Function("G_OnSuccess(" + aDataset.id + ", " + aTrans.id + ");"));
aTrans.attachEvent ("OnFail", new Function("G_OnFail(" + aDataset.id + ", " + aTrans.id + ");"));
}
}
catch (e)
{
C_msgOk("Transaction 초기화 에러 : " + e.message, "에러");
return false;
}
try
{
if (aGrid != null)
{
aGrid.DataID = aDataset.id;
G_GridInitM(aGrid);
// Grid 관련 이벤트
if (aGrid.ColumnInfo != null)
{
aGrid.attachEvent ("OnChar", new Function("G_OnCharM(" + aDataset.id + ", " + aGrid.id + ");"));
aGrid.attachEvent ("OnCloseUp", new Function("colid", "index","G_OnCloseUpM(" + aDataset.id + ", " + aGrid.id + ", index, colid);"));
aGrid.attachEvent ("OnCollapsed", new Function("index", "G_OnCollapsedM(" + aDataset.id + ", " + aGrid.id + ", index);"));
aGrid.attachEvent ("OnCollapsing", new Function("index", "return G_OnCollapsingM(" + aDataset.id + ", " + aGrid.id + ", index);"));
aGrid.attachEvent ("OnCopy", new Function("CellSelected", "BlockSelected", "G_OnCopyM(" + aDataset.id + ", " + aGrid.id + ", CellSelected, BlockSelected);"));
aGrid.attachEvent ("OnDrag", new Function("colid", "index", "return G_OnDragM(" + aDataset.id + ", " + aGrid.id + ", index, colid);"));
aGrid.attachEvent ("OnDragging", new Function("colid", "index", "return G_OnDraggingM(" + aDataset.id + ", " + aGrid.id + ", index, colid);"));
aGrid.attachEvent ("OnDrop", new Function("colid", "index", "data", "G_OnDropM(" + aDataset.id + ", " + aGrid.id + ", index, colid, data);"));
aGrid.attachEvent ("OnDropDown", new Function("colid", "index", "G_OnDropDownM(" + aDataset.id + ", " + aGrid.id + ", index, colid);"));
aGrid.attachEvent ("OnEnter", new Function("colid", "index", "G_OnEnterM(" + aDataset.id + ", " + aGrid.id + ", index, colid);"));
aGrid.attachEvent ("OnError", new Function("ecode", "estring", "G_OnErrorM(" + aDataset.id + ", " + aGrid.id + ", ecode, estring);"));
aGrid.attachEvent ("OnExit", new Function("colid", "index", "orgtext", "return G_OnExitM(" + aDataset.id + ", " + aGrid.id + ", index, colid, orgtext);"));
aGrid.attachEvent ("OnExpanded", new Function("index", "G_OnExpandedM(" + aDataset.id + ", " + aGrid.id + ", index);"));
aGrid.attachEvent ("OnExpanding", new Function("index", "return G_OnExpandingM(" + aDataset.id + ", " + aGrid.id + ", index);"));
aGrid.attachEvent ("OnFirstUp", new Function("G_OnFirstUpM(" + aDataset.id + ", " + aGrid.id + ");"));
aGrid.attachEvent ("OnHeadCheckClick", new Function("G_OnHeadCheckClickM(" + aDataset.id + ", " + aGrid.id + ");"));
aGrid.attachEvent ("OnKeyDown", new Function("kcode,keystate", "return G_OnKeyDownM(" + aDataset.id + ", " + aGrid.id + ", kcode,keystate);"));
aGrid.attachEvent ("OnKillFocus", new Function("G_OnKillFocusM(" + aDataset.id + ", " + aGrid.id + ");"));
aGrid.attachEvent ("OnLastDown", new Function("G_OnLastDownM(" + aDataset.id + ", " + aGrid.id + ");"));
aGrid.attachEvent ("OnLButtonDblClk", new Function("type","index", "colid", "x", "y", "G_OnLButtonDblClkM(" + aDataset.id + ", " + aGrid.id + ", type, index, colid, x, y);"));
aGrid.attachEvent ("OnLButtonDown", new Function("type","index", "colid", "x", "y", "G_OnLButtonDownM(" + aDataset.id + ", " + aGrid.id + ", type, index, colid, x, y);"));
aGrid.attachEvent ("OnLButtonUp", new Function("type","index", "colid", "x", "y", "G_OnLButtonUpM(" + aDataset.id + ", " + aGrid.id + ", type, index, colid, x, y);"));
aGrid.attachEvent ("OnMenuSelected", new Function("code", "text", "G_OnMenuSelectedM(" + aDataset.id + ", " + aGrid.id + ", code, text);"));
aGrid.attachEvent ("OnPaste", new Function("colid", "index", "G_OnPasteM(" + aDataset.id + ", " + aGrid.id + ", index, colid);"));
aGrid.attachEvent ("OnPopup", new Function("colid", "index", "flag", "G_OnPopupM(" + aDataset.id + ", " + aGrid.id + ", index, colid, flag);"));
aGrid.attachEvent ("OnRButtonDblClk", new Function("type","index", "colid", "x", "y", "G_OnRButtonDblClkM(" + aDataset.id + ", " + aGrid.id + ", type, index, colid, x, y);"));
aGrid.attachEvent ("OnRButtonDown", new Function("type","index", "colid", "x", "y", "G_OnRButtonDownM(" + aDataset.id + ", " + aGrid.id + ", type, index, colid, x, y);"));
aGrid.attachEvent ("OnRButtonUp", new Function("type","index", "colid", "x", "y", "G_OnRButtonUpM(" + aDataset.id + ", " + aGrid.id + ", type, index, colid, x, y);"));
aGrid.attachEvent ("OnSelChange", new Function("colid", "index", "return G_OnSelChangeM(" + aDataset.id + ", " + aGrid.id + ", index, colid);"));
aGrid.attachEvent ("OnSelChanged", new Function("colid", "index", "G_OnSelChangedM(" + aDataset.id + ", " + aGrid.id + ", index, colid);"));
aGrid.attachEvent ("OnSetFocus", new Function("G_OnSetFocusM(" + aDataset.id + ", " + aGrid.id + ");"));
}
}
}
catch (e)
{
C_msgOk("Grid 초기화 에러 : " + e.message, "에러");
return false;
}
return true;
}