특정 Row 위치이동
특정 행 위치로 스크롤바를 이동시킨 후 select 상태로 설정합니다.
요약
특정 행 위치로 스크롤바를 이동시킨 후 select 상태로 설정합니다.입력값
Number : 이동할 Row Index
예) 단일행의 반환 : datagrid1.setTopRow(10);
상세설명
특정 행을 그리드의 맨 위로 스크롤을 이동시키고 select 상태로 만듭니다.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko">
<head>
<meta content="IE=9" http-equiv="X-UA-Compatible">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>SoftBowl SBGrid Example</title>
<script type="text/javascript" src="../../kr/co/softbowl/js/Library/json-minified.js"></script>
<script type="text/javascript" src="../../js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../../kr/co/softbowl/js/Library/json2.js"></script>
<script type="text/javascript" src="../../kr/co/softbowl/SBGrid.js"></script>
<script type="text/javascript" src="../../js/DATA_JSON_POI_100.js"></script>
<script type="text/javascript">
SBGrid.DEF.DOMAIN = "../../";
<script>
<script type="text/javascript">
var datagrid1;
$(document).ready(function(){
__createElements();
});
function __createElements (){
var obJson = {
"strParentId" : "sbGridArea",
"strId": "datagrid1",
"strCaption": "FirstName^LastName^Company^Address^City^County^State^ZIP_Code^Phone^Fax^E-mail^HomePage Address",
"strColWidth": "100, 100, 250, 250, 180, 150, 70, 100, 110, 110, 250, 300",
"strJsonRef": "grid_data",
"strDataHeight":"29",
"strStyle": "width:100%; height:480px; ",
"strBackColorAlternate" : "#f7f7f7"
};
datagrid1 = createSBDataGrid(obJson);
var objJsonColumn = [
{ "id": "col1", "type": "input", "ref": "FirstName" },
{ "id": "col2", "type": "input", "ref": "LastName" },
{ "id": "col3", "type": "input", "ref": "Company" },
{ "id": "col4", "type": "input", "ref": "Address" },
{ "id": "col5", "type": "input", "ref": "City" },
{ "id": "col6", "type": "input", "ref": "County" },
{ "id": "col7", "type": "input", "ref": "State", "style" : "text-align:center" },
{ "id": "col8", "type": "output", "ref": "ZIP", "style" : "text-align:center" },
{ "id": "col9", "type": "output", "ref": "Phone", "style" : "text-align:center" },
{ "id": "col10", "type": "output", "ref": "Fax", "style" : "text-align:center" },
{ "id": "col11", "type": "output", "ref": "Email" },
{ "id": "col12", "type": "output", "ref": "Web" }
];
datagrid1.createColumns(objJsonColumn);
}
function setTopRow(){
datagrid1.setTopRow(10);
};
</script>
</head>
<body onload="__createElements()" class="sbgrid_body">
<div id="button_group">
<input type="button" class="sbgrid_demo_button" name="2" style="width:700px;height:30px;" onclick="setTopRow();" value="10행으로 이동 후 포커스"/>
</div>
<div class="content_group">
<div id="sbGridArea"></div>
</div>
</body>
</html>