Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
765
how to tell a cell's measurement?
posted

Hi experts, I'd like to add some column format by intercepting iggridrowsrendering event using following code. As you can see I'd like to set format only for columns whose column header is '$ Index'. If I have only '$ Index' as a single measurement, it works fine. But if I drag the brand dimension to column, this approach does not work. You can see from the image, '$ Index' measurement become the top level column header, then the brand dimension second level column header, then my data. My code can only detect the direct column header of data, is there a way I can detect 122.9% actually belongs to '$ index' measurement???

$("#pivotGrid").on("iggridrowsrendering", function (evt, ui) {
if (ui.owner.options.columns.length > 0) {
for (var i = 0; i < ui.owner.options.columns.length; i++) {
if (ui.owner.options.columns[i].headerText == "$ Index") {
ui.owner.options.columns[i].formatter = function (val, row) {
if (val === undefined)
return "";
else {
return "<span data-dollarIndex='" + val + "' class='dollarIndex'>" + val + "</span>";
}
};
}
}
}
});

Parents Reply Children
No Data