SMART datagrid v1.4 > Examples

[ grids ver.1.3.6]   Back  Forward

Cursors  Example

ValueColumn.cursor 속성을 지정하면 각 컬럼별로 데이터셀에 마우스가 올라갈 때 표시되는 마우스 커서 모양을 변경할 수 있다. 커서 이름은 DataLudi.Cursor 상수를 이용하거나, css cursor에서 사용되는 이름을 지정할 수 있다. 

아래 예제에서는 "국가", "이율", "프로젝트ID" 컬럼에 cursor 속성이 지정됐다. 

Grid - 1
rows

데이터셀의 값이나 상태에 따라 동적으로 커서를 변경하고 싶다면 DisplayOptions.cursorCallback 속성을 사용할 수 있다. 

Code -1
    grid.setDisplayOptions({
        cursorCallback: function (index) {
            if (index.column.name() == 'InterestRate' && index.getValue() < 4) {
                return DataLudi.Cursor.NOT_ALLOWED;
            }                        
            if (index.column.name() == 'CancelledAmount' && index.getValue() > 0) {
                return DataLudi.Cursor.POINTER;
            }
        }
    });

소스보기 JSP 

See Also
ValueColumn.cursor
DisplayOptions.cursorCallback
CellIndex
Examples
Focused Cell
Hello Grid