1

I have used the solution posted in the answerto change the mouse pointer on my jqgrid

But I am having an issue. When a column is frozen the mouse pointer is cursor instead of the default one I set in code.

I see it is changing the frozen column pointer to default at my method but somewhere that is being reverted back to its original css.

Community
  • 1
  • 1
Helen Araya
  • 1,886
  • 3
  • 28
  • 54

1 Answers1

1

At the time I wrote the answer jqGrid didn't had frozen columns feature.

If you would use free jqGrid 4.8 (see readme and wiki) then you don't need to do anything. Non-sortable columns have already the correct cursor. See the demo.

If you do need to use an old jqGrid version then you can do the following

var p = myGrid[0].p, cm = p.colModel,
    $frozenHeaders = $(myGrid[0].grid.fhDiv)
        .find(".ui-jqgrid-htable>thead>tr.ui-jqgrid-labels>th.ui-th-column");

$.each(myGrid[0].grid.headers, function(index, value) {
    var cmi = cm[index], colName = cmi.name;
    if(!cmi.sortable && colName !== "rn" && colName !== "cb" && colName !== "subgrid") {
        $("div.ui-jqgrid-sortable",value.el).css({cursor:"default"});
        $($frozenHeaders[index]).children("div.ui-jqgrid-sortable")
            .css({cursor:"default"});
    }
});

The corresponding demo can be found here.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • Unfortunately I can't use 4.8 because of the change in licence requirement. But your solution works for the existing 4.7 version I have. Thanks. – Helen Araya Mar 24 '15 at 20:41
  • @Amete: You are welcome! I started *my fork* under the name [free jqGrid](https://github.com/free-jqgrid/jqGrid) exactly to provide **free** version of jqGrid under MIT/GPLv2 licences. I described the reason at the beginning of [the readme] (https://github.com/free-jqgrid/jqGrid/blob/master/README.md). So you can use it you you want. – Oleg Mar 24 '15 at 21:24