Update Parent Records for Each Child Record in Table

I have a table of junction objects (ConsultationMedRec__c).  Each is related to a different MedRec (MedRec__c).  When I update the Order_Hidden__c field on the Consultation MedRec, I want the Order_Temp__c field on the related MedRec to be updated.  

I’ve tried a couple of different Javascript snippets, but none seem to be working.  I feel like I’m missing something - this seems like it should be pretty easy to do.  Here’s what I’m working with now: 

var params = arguments[0]; var $ = skuid.$;
var models = skuid.model.map();    
var consultationmedrecs = models.ConsultationMedRecs;

var rowsToUpdate = {};

$.each(consultationmedrecs.data, function(){
    rowsToUpdate[this.MedRec__c] = { Order_Temp__c: this.Order_Hidden__c };

consultationmedrecs.updateRows( rowsToUpdate );

The problem is that you are updating the Consultation Med Rec model instead of the Med Rec model.