Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what is the best solution to indentity diffirent id type in value ? #8

Open
leizard opened this issue Sep 10, 2015 · 5 comments
Open

Comments

@leizard
Copy link

leizard commented Sep 10, 2015

When I got the value like this

[o=pirate3] [o=tag2]

How can I tell which id belongs to user, which belongs to tag.
thank you

@Yermo
Copy link
Owner

Yermo commented Sep 10, 2015

Good point. It'd a bad example. Add something to your value field so you can identify which is which. I usually have the value use an array format such as {type:'person',value:'pirate3'} instead of just 'pirate3'.

@leizard
Copy link
Author

leizard commented Sep 10, 2015

yeah I think I tried that solution

{ label: labe;, value: { value: 'pirate1', content: '<div>content<div>', type: 'user' } }

but when I get date-type of element it return undefined. this is what I tried to change in the jquery.rich_textarea.js (line 5261)

text_string += "[o=" + $( elem ).attr( 'data-value' ) + $( elem ).attr( 'data-type' ) "]";

Maybe I did it wrong ?

@Yermo
Copy link
Owner

Yermo commented Sep 10, 2015

For example try changing the demo, instead of changing the source itself:

{ label: 'tag1', value: { value: {type: 'tag',value:'tag1'}, content: 'Tag1' } },

@leizard
Copy link
Author

leizard commented Sep 10, 2015

ok I will try it. thank you :D

@leizard
Copy link
Author

leizard commented Sep 11, 2015

ok now I struggle to get data value with this object

{ label: 'tag1', value: { value: {type: 'tag',value:'tag1'}, content: 'Tag1' } }

the $( elem ).attr( 'data-value' ) return a string "[Object Object]".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants