Open maartendraijer opened 9 years ago
Having serious issues with this. Definitely need to get this fixed. I am more than happy to work on this if I could get an idea of where the issue is stemming from.
just spent about 2 hours digging around the source for this - when the drag and drop is triggered, the field becomes undefined in all rows, and that somehow causes the return of the uncalled function. I think it's because some id somewhere in the dataRows structure doesn't get updated, but any insight from @nnajm would be greatly appreciated
I fixed this issue in my clone - https://github.com/michaeljosephrosenthal/orb/blob/master/dist/orb.min.js I changed some other things, but I think the main source of the bug was this diff:
diff --git a/src/js/orb.config.js b/src/js/orb.config.js
index bc52ccb..2096e5c 100644
--- a/src/js/orb.config.js
+++ b/src/js/orb.config.js
@@ -39,8 +39,8 @@ function mergefieldconfigs() {
merged.subtotals.push(nnconfig.subTotal || {});
merged.functions.push({
aggregateFuncName: nnconfig.aggregateFuncName,
- aggregateFunc: i === 0 ? nnconfig.aggregateFunc : (nnconfig.aggregateFunc ? nnconfig.aggregateFunc() : null),
- formatFunc: i === 0 ? nnconfig.formatFunc : (nnconfig.formatFunc ? nnconfig.formatFunc() : null),
+ aggregateFunc: (nnconfig.aggregateFunc ? nnconfig.aggregateFunc() : null),
+ formatFunc: (nnconfig.formatFunc ? nnconfig.formatFunc() : null),
});
}
@michaeljosephrosenthal Cool! I've tried your version and it works flawlessly.
Steps to reproduce:
1) Go to http://nnajm.github.io/orb/ 2) Drop
Quantity
to the right ofAmount
(within the Data fields) 3) Now theQuantity
cells within the grid all display:function n(e){return null!=e?e.toString():""}
.Also - perhaps related - when you drag a Data field to Fields and put it back in to Data, the formatting of the cells is gone again.