Forum closed. New forum available at http://community.wymeditor.org/

get instance index

Support forum for WYMeditor.

get instance index

Postby rvc on Tue Mar 10, 2009 11:21 pm

hi all,

i've searched a lot but can't find how to get the instance index after the creation with $.wymeditor(); since this doesn't return anything...
the problem is i don't know if there are other instance already running or not, on the time of creation; i can't assume the index is 0, 1 or whatever, like most posts/replies i found here say

if it is even possible, could someone help?

thanks in advance

awesome plug-in btw :P
rvc
 
Posts: 6
Joined: Tue Mar 10, 2009 8:01 pm

Re: get instance index

Postby mr_lundis on Wed Mar 11, 2009 1:17 pm

Hi rvc, and welcome to the WYMeditor forum!

WYMeditor.INSTANCES is what you're looking for.

Code: Select all
for(instance in WYMeditor.INSTANCES) {
    // Do something
}

Cheers!
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden

Re: get instance index

Postby rvc on Wed Mar 11, 2009 3:03 pm

yes, i can iterate them but how can i identify what is the instance i've just created.
i suppose i could assume it is the last one in the array, but...that is kinda... :roll:

well, i think what i'm talk about is the possibility to use the structure as an associative array or
something so it's possible to give labels to the instances.

so... i guess i'll just 'leave' it as a suggestion for the next version :P

thanks again :)
rvc
 
Posts: 6
Joined: Tue Mar 10, 2009 8:01 pm

Re: get instance index

Postby mr_lundis on Wed Mar 11, 2009 3:17 pm

Hi,
I thinks it's safe to assume that a newly created instance will end up last in the array, I don't see how a it could end up in any other place.
The thought of labeling the instances is none the less a very interesting idea, I'll keep that in mind for the next version. ;)

Cheers!
Jonatan Lundin - designer, developer and forum moderator. You should follow me on Twitter!
mr_lundis
 
Posts: 335
Joined: Sun Dec 02, 2007 10:59 am
Location: Sweden


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests