Hi Eulogio,
Your syntax looks correct, so I’m not sure what’s going on. What version of Skuid are you running?
I’m using 7.27.1. And yeah the documentation says this is correct, so I’m not sure what the issue is.
Can you paste the relevant portion of the code. Maybe the entire snippet if it’s not too long?
Sure! What I’m doing is moving rows from one model to another, and then adding a final row that has aggregated info:
$.each(allModels, function() { var rowCopies = this.getRows(); rowCopiese0].Bucket = this.id; // row is prepended here bucketModel.adoptRows(rowCopies); }); var row = bucketModel.createRow(); row.Bucket = 'TOTAL'; row.countId = countTotal; row.sumTBAAggregateCharterc = charterTotal; row.sumTBAAggregateDistrictc = districtTotal; row.sumTBAAggregatePrivatec = privateTotal; row.sumTBAAggregateMalec = maleTotal; row.sumTBAAggregateFemalec = femaleTotal; row.sumTBAAggregateAfricanAme = afroTotal; row.sumTBAAggregateAsianAmeri = asianTotal; row.sumTBAAggregateHispanicc = hispanicTotal; row.sumTBAAggregateWhitec = whiteTotal; // should be appended here bucketModel.adoptRow(row, { doAppend: true }); // updating rows to refresh table visual var allRows = bucketModel.getRows(); bucketModel.updateRows(allRows);
And as you can see below, the row is still prepended on this table, regardless of what I set the flag.
I think the problem is that your creating the row with createRow first, and then calling adoptRow. Adopt row will only adjust the position of a row if it’s not already in the model. Try using the doAppend option on your create row api call.