Я загружаю сетку чередованием и замороженными столбцами. Загружается правильно. Первая строка белая, вторая серая. При выполнении сортировки в одном из столбцов замороженная сторона начинается серым цветом, а другая сторона - белым.
Версия 4.15.6-free Как настроить цвета? введите описание изображения здесь
.myAltRowClass {
background: #E0E0E0;
}
jqTreeGrid - Test zebra
listaData=[
{"termId":51843,"module":"M","option":"W","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"","quantityFrozenFields":0,"languagesTerms":["D","","","","",""],"languagesTips":["","","","","",""]},
{"termId":52192,"module":"M","option":"P","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"","quantityFrozenFields":0,"languagesTerms":["","","","","",""],"languagesTips":["","","","","",""]},
{"termId":52338,"module":"B","option":"P","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"","quantityFrozenFields":0,"languagesTerms":["","","","","",""],"languagesTips":["","","","","",""]},
{"termId":52339,"module":"B","option":"","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"","quantityFrozenFields":0,"languagesTerms":["","","","","",""],"languagesTips":["","","","","",""]},
{"termId":52341,"module":"B","option":"S","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"","quantityFrozenFields":0,"languagesTerms":["","","","","",""],"languagesTips":["","","","","",""]},
{"termId":52342,"module":"B","option":"P","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"","quantityFrozenFields":0,"languagesTerms":["","","","","",""],"languagesTips":["","","","","",""]},
{"termId":52343,"module":"B","option":"D","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"","quantityFrozenFields":0,"languagesTerms":["","","","","",""],"languagesTips":["","","","","",""]},
{"termId":52344,"module":"B","option":"D","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"","quantityFrozenFields":0,"languagesTerms":["","","","","",""],"languagesTips":["","","","","",""]},
{"termId":52345,"module":"B","option":"","termDescription":"xxx xxx xxx xxx xxx xxx xxxs","termWidth":"0","orderGrid":"0","menuStructure":"","quantityFrozenFields":0,"languagesTerms":["","","","","",""],"languagesTips":["","","","","",""]},
{"termId":52346,"module":"B","option":"P","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"","quantityFrozenFields":0,"languagesTerms":["","","","","",""],"languagesTips":["","","","","",""]},
{"termId":52347,"module":"B","option":"P","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"","quantityFrozenFields":0,"languagesTerms":["","","","","",""],"languagesTips":["","","","","",""]},
{"termId":52348,"module":"B","option":"","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"","quantityFrozenFields":0,"languagesTerms":["","","","","",""],"languagesTips":["","","","","",""]},
{"termId":52349,"module":"B","option":"P","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"","quantityFrozenFields":0,"languagesTerms":["","","","","",""],"languagesTips":["","","","","",""]},
{"termId":52340,"module":"B","option":"","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"","quantityFrozenFields":0,"languagesTerms":["","","","","",""],"languagesTips":["","","","","",""]},
{"termId":51848,"module":"B","option":"B","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"1","quantityFrozenFields":0,"languagesTerms":["B","B","x","y","z","w"],"languagesTips":["B","","","","",""]},
{"termId":51841,"module":"B","option":"S","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"1.01","quantityFrozenFields":0,"languagesTerms":["P","S","","","",""],"languagesTips":["P","","","","",""]},
{"termId":51842,"module":"B","option":"A","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"1.01.01","quantityFrozenFields":0,"languagesTerms":["S","A","","","",""],"languagesTips":["U","","","","",""]},
{"termId":52011,"module":"B","option":"U","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"1.01.01.01","quantityFrozenFields":0,"languagesTerms":["U","U","","","",""],"languagesTips":["","","","","",""]},
{"termId":51844,"module":"B","option":"P","termDescription":"xxx xxx xxx xxx xxx xxx xxx","termWidth":"0","orderGrid":"0","menuStructure":"1.01.01.02","quantityFrozenFields":0,"languagesTerms":["P","Ps","","","",""],"languagesTips":["P","","","","",""]}];
var colModel = [{ label:'Module', name: 'module', width: 160, frozen: true},
{ label:'Option', name: 'option', width: 160, frozen: true},
{ label:'Description', name: 'termDescription', width: 160, cellattr: function (rowId, tv, rawObject, cm, rdata) { return 'style="white-space: normal !important;"' }, frozen: true},
{ label:'Strucuture', name: 'menuStructure', width: 80},
{ label: 'termId', name: 'termId', width: 10, hidden: true },
{ label:'Pt', name: 'languagesTerms.0', width:100, cellattr: function (rowId, tv, rawObject, cm, rdata) { return 'style="white-space: normal !important;"' }, editable: false},
{ label:'Pt', name: 'languagesTips.0', width:150, cellattr: function (rowId, tv, rawObject, cm, rdata) { return 'style="white-space: normal !important;"' }, editable: false, hidden: true},
{ label:'En', name: 'languagesTerms.1', width:100, editable: false},
{ label:'En', name: 'languagesTips.1', width:150, editable: false, hidden: true},
{ label:'Tu', name: 'languagesTerms.2', width:100, editable: false},
{ label:'Tu', name: 'languagesTips.2', width:150, editable: false, hidden: true},
{ label:'Cn', name: 'languagesTerms.3', width:100, editable: false},
{ label:'Cn', name: 'languagesTips.3', width:150, editable: false, hidden: true},
{ label:'Al', name: 'languagesTerms.4', width:100, editable: false},
{ label:'Al', name: 'languagesTips.4', width:150, editable: false, hidden: true},
{ label:'Ce', name: 'languagesTerms.5', width:100, editable: false},
{ label:'Ce', name: 'languagesTips.5', width:150, editable: false, hidden: true}];
var lastSelection ;
jQuery(document).ready(function($) {
jQuery('#jqGrid').jqGrid({
datatype: "local",
data: listaData,
height: 300,
width : 900,
colModel:colModel,
loadonce: true,
shrinkToFit: false,
rowNum: 500,
scroll: 0,
multiSort: false,
loadComplete: function() {
$("tr.jqgrow:odd").addClass('myAltRowClass');
}
});
$("#jqGrid").jqGrid("setFrozenColumns");
});
Спасибо