This question has been answered by Tyreal2012. See the first response.
<?php
$gridcontextmenus['showMyPreview']['code']="
m.push({
className : 'showMyPreview',
text: 'Show Preview',
handler: 'this.showMyPreview'
});
m.push('-');
";
$gridcontextmenus['showMyPreview']['handler'] = 'this.showMyPreview';
$gridfunctions['this.showMyPreview'] = "
showMyPreview: function(btn,e) {
var object_id = this.menu.record.id;
var tpl = 'mypreview.html';
var action = 'u';
this.loadIframeWin(btn,e,tpl,action);
}
";
<?php
$config = $modx->migx->customconfigs;
//todo: make this configurable
$tpl = $modx->getOption('iframeTpl',$scriptProperties,'default.html');
$tpl = $modx->getOption('core_path') .'components/yourPackage/migxtemplates/mgr/iframechunks/'.$tpl;
$modx->toPlaceholders($modx->migx->config,'migx_config');
$modx->toPlaceholders($_REQUEST,'request');
return $modx->migx->renderChunk($tpl);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Preview</title>
<meta charset="utf-8" />
<base href="[[++site_url]]" />
</head>
<body>
<div id="content">
<h2>Preview</h2>
[[migxLoopCollection?
&packageName=`yourPackage`
&classname=`yourClassname`
&where=`{"id":"[[+request.object_id]]"}`
&tpl=`detailTpl`
]]
</div>
</body>
</html>
[14:21:35.978] TypeError: Ext.get(...) is null
<?php
$gridcontextmenus['showMyPreview']['code']="
m.push({
className : 'showMyPreview',
text: 'Show Preview',
handler: 'this.showMyPreview'
});
m.push('-');
";
$gridcontextmenus['showMyPreview']['handler'] = 'this.showMyPreview';
$gridfunctions['this.showMyPreview'] = "
showMyPreview: function(btn,e) {
var object_id = this.menu.record.id;
var tpl = 'mypreview.html';
var action = 'u';
this.loadIframeWin(btn,e,tpl,action);
}
";
?>
<?php
$config = $modx->migx->customconfigs;
//todo: make this configurable
$tpl = $modx->getOption('iframeTpl',$scriptProperties,'default.html');
$tpl = $modx->getOption('core_path') .'components/inventory/migxtemplates/mgr/iframechunks/'.$tpl;
$modx->toPlaceholders($modx->migx->config,'migx_config');
$modx->toPlaceholders($_REQUEST,'request');
return $modx->migx->renderChunk($tpl);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Preview</title>
<meta charset="utf-8" />
<base href="[[++site_url]]" />
</head>
<body>
<div id="content">
<h2>Preview</h2>
[[migxLoopCollection?
&packageName=`inventory`
&classname=`inventory`
&where=`{"id":"[[+request.object_id]]"}`
&tpl=`detailTpl`
]]
</div>
</body>
</html>
[[migxLoopCollection?
&packageName=`yourPackage`
&classname=`yourClassname`
&where=`{"id":"[[+request.object_id]]"}`
&tpl=`detailTpl`
]]
does it fire a request?
what is the response, if it does?
here is your classname and packageName missing:
[[migxLoopCollection? &packageName=`yourPackage` &classname=`yourClassname` &where=`{"id":"[[+request.object_id]]"}` &tpl=`detailTpl` ]]
[[+request.object_id]]
[[migxLoopCollection?
&packageName=`inventory`
&classname=`inventory`
&where=`{"id":"21"}`
&tpl=`detailTpl`
]]