¡á Grid.OnPaste

SECTION

 

Event

SINCE

 

NewPacket : N/A          Max : 1,2,1,159      Unicode : 2,0,1,142

DESCRIPTION

 

BlockPasteMode°¡ TRUE·Î ÁöÁ¤µÇ°í, Edit âÀÌ È°¼ºÈ­ µÇÁö ¾ÊÀº »óÅ¿¡¼­(ÀÔ·ÂÁß »óÅ°¡ ¾Æ´Ñ »óÅÂ) Ctrl+VÅ°¸¦ ´©¸¥ °æ¿ì À̺¥Æ®°¡ ¹ß»ýµÈ´Ù.

OnPaste Event Handler ³»¿¡¼­ ClipBoard°´Ã¼, Script, Grid, DataSet ¸Þ¼Òµå¿Í ¼Ó¼ºÀ» ÀÌ¿ëÇÏ¿© ¿øÇÏ´Â ÇüÅÂÀÇ ºÙ¿© ³Ö±â¸¦ ¼öÇà ÇÒ ¼ö ÀÖ´Ù.

-         À̺¥Æ® ¸¸ ¹ß»ýÇϸç, Grid ³»ºÎÀûÀ¸·Î ºÙ¿© ³Ö±â¸¦ ¼öÇàÇÏÁö´Â ¾Ê´Â´Ù.

-         Ŭ¸³º¸µå Text¸¦ DataSetÀÇ Method¸¦ ÅëÇÏ¿© ÀÔ·ÂÇÏ´Â °æ¿ì Grid¿¡ Á÷Á¢ ÀÔ·Â ÇÏ´Â °ÍÀÌ ¾Æ´Ï±â ¶§¹®¿¡ GridÀÇ ÀÔ·ÂÁ¦ÇÑ, ColumnÀÇ Show/Hideµî 󸮿¡ ÁÖÀÇ°¡ ÇÊ¿äÇÏ´Ù.

SYNTAX

 

<script language=JavaScript for=GridID event=OnPaste(row,colid)>

</script>

POSSIBLE VALUES

 

ÇØ´ç¾øÀ½

PARAMETERS

 

LONG row : Grid¿¡¼­ Event°¡ ¹ß»ýÇÑ ½ÃÁ¡¿¡ ÇöÀç ¼±ÅÃµÈ Row Index

BSTR colid : Grid¿¡¼­ Event°¡ ¹ß»ýÇÑ ½ÃÁ¡¿¡ ÇöÀç ¼±ÅÃµÈ ColumnÀÇ ID

 

ÇöÀç ¼³Á¤µÈ SelectionMode¿Í ¼±Åõ¿ÀÛ¿¡ µû¶ó ºÙ¿© ³Ö±â ½ÃÀÛ ¼¿ÀÇ ÁÂÇ¥´Â ´Þ¶óÁö´Âµ¥, Grid View ¿µ¿ª¿¡ ´ÜÀÏ ¼¿ ¼±ÅÃÀÌ µÇ¾î ÀÖ´Â °æ¿ì´Â ÇØ´ç ¼¿ÀÇ ÁÂÇ¥°¡, ºí·Ï ŸÀÔÀ¸·Î ´ÙÁß ¼¿ÀÌ ¼±ÅÃÀÌ µÇ¾î ÀÖ´Â °æ¿ì¿¡´Â ´ÙÁß ¼¿ÀÇ ¼±Åà µ¿ÀÛÀÌ ½ÃÀÛµÈ ¼¿ÀÇ ÁÂÇ¥°¡, Row ´ÜÀ§ ¼±ÅÃÀÎ °æ¿ì¿¡´Â ½ÃÀÛ RowÀÇ Ã¹ ¹ø° Ä÷³¿¡ ÇØ´çÇÏ´Â ¼¿ÀÇ ÁÂÇ¥°¡ Àü´ÞµÈ´Ù.

RETURN VALUES

 

ÇØ´ç¾øÀ½

EXAMPLE

 

[JavaScript]

<script language=JavaScript for=GridID event=OnPaste(row,colid)>

    alert("Occur OnPaste Event :" + "<ROW :" + Row +">"+ "<Colid :" + Colid + ">" )

var strMatrix;

strMatrix = window.clipboardData.getData("Text");

if(strMatrix != null)

{

Tb_Grid.ReDraw=false;

var strRows = strMatrix.split("\r\n"); // °³Ç๮ÀÚ·Î ºÐ¸®

for (i = 0; i < strRows.length; i++)

{

if (Tb_DataSet.CountRow >= (row + i) && strRows[i] != "")

{

Tb_DataSet.RowPosition = row + i;

var StartColIdx = Tb_Grid.GetColumnIndex(colid);

var strCols = strRows[i].split("\t"); // Åǹ®ÀÚ·Î ºÐ¸®

for (j = 0; j < strCols.length; j++)

{

                           if (Tb_Grid.CountColumn >= (StartColIdx + j))

                               Tb_DataSet.NameString(row + i, Tb_Grid.GetColumnID(Tb_Grid.GetColumnIndex(colid)+j) ) = strCols[j];

                     }

                }

}

Tb_Grid.ReDraw=true;

}

</script>

SAMPLE

 

./sample/OnPaste.html

SEE ALSO

 

BlockPasteMode, DataClip, SelectionMode, OnCopy, CurCol, CurRow, SelCol, SelRow, CountColumn