I'm trying to use a grid column template to add a third-party widget to the cells of that column. So far, my best idea has been to template the column like so:
The PromotionalSKUs.setupSKULookup method creates the widget like so:
However. This method never gets called. Is there some way for me to call a method to initialize my widget when the template is converted to HTML and added to the DOM?
columns: [
{field:
'SKUId'
,
width: 150,
title:
'SKU'
,
template:
'<div id="skulookup_#= promotionskuId #" onreadystatechange="PromotionalSKUs.setupSKULookup(this)" />'
}
]The PromotionalSKUs.setupSKULookup method creates the widget like so:
function
setupSKULookup(element) {
if
(element.readyState ==
"complete"
)
$(element).lookup({});
}
However. This method never gets called. Is there some way for me to call a method to initialize my widget when the template is converted to HTML and added to the DOM?