Wijmo UI for the Web
Allowing column movement
Wijmo User Guide > Widgets > Grid > Grid Concepts > Columns > Allowing column movement

The wijgrid widget allows you to move columns by using allowColMoving option to true.

For example, the script below allows you to change column position by dragging the column header and dropping it at a new position.

Script
Copy Code
<script id="scriptInit" type="text/javascript">
    require(["wijmo.wijgrid"], function () {
    $(document).ready(function () {
        $("#wijgrid").wijgrid({
            cellClicked: function (e, args) {
                alert(args.cell.value());
            },
            allowSorting: true,   
            allowColMoving: true,   // allows movement of column        
            data: [
                [27, 'Canada', 'Adams, Craig', 'RW'],
                [43, 'Canada', 'Boucher, Philippe', 'D', 'R'],
                [24, 'Canada', 'Cooke, Matt', 'LW', 'L'],
                [87, 'Canada', 'Crosby, Sidney (C)', 'C', 'L'],
                [1, 'United States', 'Curry, John', 'G', 'L'],
            ],
            columns: [
                {headerText: "Number", dataType:'number'},
                {headerText: "Nationality", dataType:'string'},
                {headerText: "Player", dataType:'string'},
                {headerText: "Position", dataType:'string'},
      
            ]
        });
    });
    });  
</script>