{ text : 'City', field : 'city' ,ascending : true ,
renderer : function(ref) {
var value = ref.value,
record = ref.record,
data = ref.record.data,
rowElementCls = ref.row.cls,
cellElement = ref.cellElement,
prevRecord = record.firstStore ? record.firstStore.getPrev(record,true ,true) : '',
nextRecord = record.firstStore ? record.firstStore.getNext(record,true ,true) : '';
console.log('1',record.city, nextRecord.city, prevRecord.city);
if (record.city!== prevRecord.city ) {
cellElement.classList.add('cell-group-start');
} else if (nextRecord && (nextRecord.city=== record.city)) {
cellElement.classList.add('cell-group');
return '';
} else {
cellElement.classList.add('cell-group-end');
return '';
}
return record.city;
//return ref.record.city;
}
},
Sorting the city column. screenshot attached
While I search 'Paris' the record.city, nextRecord.city, prevRecord.city all become 'Paris' and city column is empty as in screenshot. Is there a better way to achieve this?
I would not apply the rowspan logic when grouped, they both kind of defeat the purpose of the other. Try skipping it if firstStore.isGrouped and return the value for the cell as usual instead