[fusion-users] Re: Reference JxDialog from a different control
Paul Spencer
pspencer at dmsolutions.ca
Thu Oct 6 15:00:25 EDT 2011
Um, I guess that version of MGE didn't include the latest jxlib. Here is the implementation:
function $jx(id) {
var widget = null;
id = document.id(id);
if (id) {
widget = id.retrieve('jxWidget');
if (!widget && id != document.body) {
widget = $jx(id.getParent());
}
}
return widget;
}
I am hopeful it would work with an older version of JxLib but it might not if your version of JxLib doesn't 'store' jxWidget on the element in which a widget is created. If it doesn't work, your best bet would be to assign a reference to your dialog in a global namespace from which you can access it in other code. You could prevent massive pollution by creating an object,
window.myStuff = {}
then where you create the dialog, use window.myStuff.myDialog = new Jx.Dialog( ... );
and where you want to collapse it, you can do window.myStuff.myDialog.toggleCollapse(); or some such.
Cheers
Paul
On 2011-10-06, at 12:43 PM, pwong wrote:
> sorry Paul, it did not work. Firebug says "$jx is not defined".
>
> Some more info on the problem.
>
> What I have is a dialog that shows in the middle of the screen on top of the
> map, after a search is performed, a list of records is displayed in that
> dialog in a standard HTML table as content. When a user clicks on one of
> the records, I want the dialog to automatically collapse itself so that the
> user doesn't have to manually collapse the dialog to view the underlying
> map. I'm using MapGuide Enterprise 2011's implementation of JxLib.
>
> --
> View this message in context: http://osgeo-org.1803224.n2.nabble.com/Reference-JxDialog-from-a-different-control-tp6845317p6866546.html
> Sent from the Fusion Users mailing list archive at Nabble.com.
> _______________________________________________
> fusion-users mailing list
> fusion-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-users
__________________________________________
Paul Spencer
Chief Technology Officer
DM Solutions Group Inc
http://research.dmsolutions.ca/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fusion-users/attachments/20111006/f217dba2/attachment.html
More information about the fusion-users
mailing list