Ok, I came up with a solution to this problem on my own. Here is how I handled this.
Basically, I created two models. They both read in via XML files on init. Then, I preprocess all of the data in the init and store the object and then render the view manually with the new modified data.
Hope this helps someone.
init : function(){
// Fetch relevant Model data from all of our data feeds
var datatableDef= Softplchmi.Models.Hmimain.findAll(),
controlsDef = Softplchmi.Models.Control.findAll(),
hmiDef = Softplchmi.Models.Hmi.findAll();
var el = this.element;
// Perform all of the FindAll calls and then when complete, loop through and filter
$.when(datatableDef,controlsDef, hmiDef).done(function(dtResponse, controlResponse, hmiResponse){
//parse Datatable to see if there are any values to substitiute matching our params
$.each(dtResponse[0], function(iDataIndex, valDatatable) {
for (var dkey in valDatatable) {
if (valDatatable.hasOwnProperty(dkey)) {
//console.log(dkey + " -> " + valDatatable[dkey]);
if (valDatatable[dkey].indexOf('%%') !== -1) {
//console.log("Found:" + valDatatable[dkey]);
// Loop through HMI Controls and see if we can find a match
$.each(hmiResponse[0], function(iHmiIndex, valHmi) {
if (valDatatable[dkey] == valHmi.id) {
//console.log (valHmi.name);
// Replace the key value with new data
valDatatable[dkey] = valHmi.defaultimage;
}
});
}
}
}
}); // End Datatable Parse
var htmlDat = $.View( '//softplchmi/hmimain/views/init', dtResponse[0]);
//console.log(htmlDat);
el.html(htmlDat);
}); //End When Statement
}