AnanthaKN / jquery-in-place-editor

Automatically exported from code.google.com/p/jquery-in-place-editor
Other
0 stars 0 forks source link

Feature Request: Make select_options expect an array value #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Make the select_options expect an array value instead of a comma-delimited
value set.

This should make jQuery/Javascript code look a bit cleaner.

Original issue reported on code.google.com by warp...@gmail.com on 12 Oct 2009 at 7:12

GoogleCodeExporter commented 9 years ago
Disregard this - I already have a fix for this one.  I'll submit a patch later.

Original comment by warp...@gmail.com on 12 Oct 2009 at 10:15

GoogleCodeExporter commented 9 years ago
Hey warpkat, I'd be very keen to see your solution to this, as longer dropdowns 
make
the code very dense, and I've tried a couple of ways of achieving the result 
but my
Javascript skills aren't too hot.

Thanks in advance!

Original comment by FrankEBa...@gmail.com on 17 Dec 2009 at 1:32

GoogleCodeExporter commented 9 years ago
I have changes in my copy of the editor at 
<http://haecker.me/trac/browser/open-source/jquery-edit-in-
place/trunk> that also incorporate this patch plus another one that allows you 
to specify individual option 
entries as another (optional) array so no string parsing is involved when 
decideding what the value and what the 
label is. Which now allows the lable to contain a ':'.

Original comment by martin.h...@googlemail.com on 14 Feb 2010 at 1:43

GoogleCodeExporter commented 9 years ago
Hi Martin, could you possible let us have an example of how we can pass an 
array to
select_options? Just a short code snippet would be very useful.

Thanks in advance!

Original comment by FrankEBa...@gmail.com on 9 Mar 2010 at 6:10

GoogleCodeExporter commented 9 years ago
There are unit tests and it has an example in the documentation.

-- snip --
    select_options:     "", // string or array: Used if field_type is set to 'select'. Can be comma delimited 
list of options 'textandValue,text:value', Array of options ['textAndValue', 
'text:value'] or array of arrays 
['textAndValue', ['text', 'value']]. The last form is especially usefull if 
your labels or values contain colons)
-- snap --

Is there any information missing there?

Original comment by mhaec...@gmail.com on 23 Mar 2010 at 10:13