I'm with a problem using jqgrid with some options, better that write is show you an image:
So, when I'm construction the table body (with ajax call) I'm passing an hidden field. When something is grouped, I want to show that hidden field where 'undefined' word is (group title).
Is there any solution using formatDisplayField
?
What I have is something like:
groupingView : {
groupField : ['cpv'],
groupCollapse : true,
groupOrder: ['desc'],
plusicon: 'ui-icon-circle-plus',
minusicon: 'ui-icon-circle-minus',
formatDisplayField: [
function (value) { // Should be cpv_parent (hidden by default but sent to jggrid when instantiate)
console.log(value); // Contain CPV Grouped
console.log($(this)); // Contain [table#ajaxTable.ajaxTable.ui-jqgrid-btable, context: table#ajaxTable.ajaxTable.ui-jqgrid-btable, constructor: function, init: function, selector: "", jquery: "1.7.2"…]
//return String(displayValue).substring(0, 5);
}
],
isInTheSameGroup: function (x, y) {
return String(x).substring(0, 5) === String(y).substring(0, 5);
}
}
EDIT As required, heres a sample data form what i'm using (from last try (using userData)):
{"total":1,"page":1,"totalrecords":3,"userdata":{"98513295":"98000000-3"},"rows":[{"tipoConcurso":"Ajuste Directo (Regime Geral)","createdOn":"2014-04-23 16:19:56","valor":15000,"cpv":98513295,"cpvParent":"98000000-3"},{"tipoConcurso":"Ajuste Directo (Regime Geral)","createdOn":"2013-10-01 16:05:08","valor":15000,"cpv":98513295,"cpvParent":"98000000-3"},{"tipoConcurso":"Ajuste Directo (Regime Geral)","createdOn":"2013-09-03 17:34:39","valor":15000,"cpv":98513295,"cpvParent":"98000000-3"}]}
Thanks @Oleg :)
Thank you all in advance :)
Regards, Marcelo