Async Callback
GarryLowther opened this issue · 2 comments
GarryLowther commented
I could not find an example of populating my loaded template via dynamic code.
For example, I want to load a div from template HTML, then get a callback when this is fully loaded so that I can then commence population from a web service under my control.
GarryLowther commented
I did manage to get this working:
LoadTemplateTest: function()
{
var options = {
success: function (selection)
{
TriSysApex.Toasters.Info("Worked: " + selection);
}
};
var sTemplateId = '#ctrlPropertySheet-object-template';
var sTemplateHTML = $(sTemplateId).html();
//$("#dataFields-LoadTemplateTest").loadTemplate(sTemplateHTML, null, options); Breaks, big time!
$("#dataFields-LoadTemplateTest").loadTemplate(sTemplateId, null, options);
},
The selection parameter in the callback function is undefined.
codepb commented
This library is about populating the template from JSON data. If you want to handle the population yourself, you don't need this library. You already have your template in sTemplateHTML. I don't understand why you aren't just populating the data in this.