AnanthaKN / jquery-in-place-editor

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

non-continuous array as select_option #48

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. var arr_x = new Array()
2. arr_x[1]=10;
3. arr_x[2]=11
4. use selected_options: arr_x in editinplace for "select"

What is the expected output? What do you see instead?

I would like/expect to see a select box with 2 entries with values 1/2 and
text 10/11.  Instead no dropdown is produced - It seems to find arr_x[0]
undefined and just stop.  Similar behaviour if any non-contiguous array is
given - no select list is produced.  Could it not ignore undefined
elements, and/or iterate over the array items as opposed to linearly
starting from 0? (not sure how it operates right now - I'll look into it)

What version of the product are you using? On what operating system?
latest - 2010.03.24 download 

Please provide any additional information below.

Original issue reported on code.google.com by ati.ross...@gmail.com on 24 Mar 2010 at 10:34

GoogleCodeExporter commented 8 years ago
adding an if block at line 233:
if (currentTextAndValue!=undefined){
...
   editor.append(option);
}

resolves this problem, and skips undefined entries. This was important since 
after
add/deletes, dictionary data has non-contiguous ID-s :)  Hope others can use 
this. 
Great Script!!! thank you

Original comment by ati.ross...@gmail.com on 24 Mar 2010 at 10:43

GoogleCodeExporter commented 8 years ago
Sure, I can put that in, but I'm not quite sure I understand why this is needed 
for you? Why can't you just start 
your parameter arrays at 0?

Original comment by mhaec...@gmail.com on 25 Mar 2010 at 9:25

GoogleCodeExporter commented 8 years ago
Please feel free to reopen this issue if you feel there is something still 
missing in the editor here.

Original comment by mhaec...@gmail.com on 28 Mar 2010 at 5:48