这篇文章介绍如何使用 JS 设置行背景色,及如何锁定行。

JS 代码:
 
<script language="javascript" type="text/javascript">

<!--



        function Button1_onclick() {

            var spread = document.all("FpSpread1");

            var table = FpSpread1.all("FpSpread1_Viewport");

            var tr = table.rows(spread.ActiveRow);

            tr.bgColor = "Red";



            var iActiveRow, iActiveCol;

            //循环次数为 Spread 列数

            for (var i = 0; i < 4; i++) {

                iActiveRow = FpSpread1.ActiveRow;

                var cell = FpSpread1.GetCellByRowCol(iActiveRow, i);

                cell.setAttribute("FpCellType", "readonly");

            }

        }



// -->

    </script>

复制代码
设置前图片
(2.77 M, 下载次数:24)