Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2007-09-29 11:21:42

mark_d_drake
New member
Registered: 2007-09-29
Posts: 4

Find parent of original TextArea

If you have a XindaEditor is there a way to find the parentNode of the textarea that was used to instantiate the Xinha instance (Or a way to get the Xinha instance from the parentNode). I'm trying to avoid having to pass both the Xinha instance and the it's container to a javascript function.

Also, given an arbitary JavaScript object is there a foolproof way to find out if it's a Xinha..

Thx

M.

Last edited by mark_d_drake (2007-09-29 11:22:09)

Offline

#2 2007-10-01 05:13:54

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Find parent of original TextArea

var xinha_table = xinha_editors.youreditor._htmlArea; // this the Xinha table that lives where the textarea used to be
var container =  xinha_table.parentNode;

To check whether a given object is a Xinha you could check for the existence of a characteristic member, e.g.

var isItaXinha = typeof yourobject._htmlArea == 'object';

Offline

Board footer

Powered by FluxBB