ColorPicker js error on "picking" when array.prototype used

2 posts, 0 answers
  1. Boleslav Malynovsky
    Boleslav Malynovsky avatar
    2 posts
    Member since:
    Apr 2010

    Posted 20 Apr 2010 Link to this post

    Hello, Telerik!

    I believe you guys read such threads, so I hope this would help you or someone else in the components using/improvements.

    I don't know if the bug already fixed or found, but anyway...

    I spent some time to get to know why my ColorPicker gives js error when trying to open palette and thanks to IE 8 debugger it didn't take so much time.
    So the problem is:

    I use the following code on my site:

    Array.prototype.exists = function('value'){} to be able easily search items in array and it's pretty convenient approach with prototypes using.
    but your ColorPicker initializes with colors as "hash" array like this._items = eval('[{'value', ''},{'title',''}]')
    there is for(var i in thsi._items) used when the palette building instead of for(var i = 0; i < this._items.length... (not sure why) 
    but since "exists" is a part of the array one of the elements as "var _13 = this._items[i]" becomes the function I've defined. And it fails of course  when _13.value is going to be applied to (at least in IE).

    So now I have some "pervertions" (like $find('picker')._items["exists"] = {'value', ''},{'title',''}) since use "exists" along the site framework...

    The best!
  2. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 22 Apr 2010 Link to this post

    Hello Boleslav Malynovsky,
    I can recall that there was such a problem in one of the previous versions of the color picker. A client of ours reported it to us and we fixed it. I am not quite sure which version of the suite you use, but you should not be able to reproduce the problem with the latest version - 2010.1 415.

    All the best,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft R3 2016 release webinar banner
Back to Top