This is a migrated thread and some comments may be shown as answers.

Customized Color picker tool item performance issue

5 Answers 76 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Kriengsak Multongjard
Top achievements
Rank 1
Kriengsak Multongjard asked on 28 Dec 2010, 12:20 PM
We have added a color picker Tool Item using teh following configuration:

 

<tool name="ApplyBackColor" type="dropdown" ItemsPerRow="10" popupheight="120px">
      <item  name="<img  src='./_wpresources/RadEditorSharePoint/5.4.1.0__1f131a624888eeed/Resources/ToolImages/colors/ffffff.png' alt='#'/>" value=""/>
      <item  name="<img  src='./_wpresources/RadEditorSharePoint/5.4.1.0__1f131a624888eeed/Resources/ToolImages/colors/000000.png' alt='#000000'/>" value="#000000"/>

But the performance is extremely slow. there are around 50 colors that we want to display, and each color icon takes about .5 seconds to load.

Kindly suggest some better solution or performance improvement idea?

5 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 29 Dec 2010, 05:51 PM
Hi Kriengsak,

The only possible way to increase the loading speed of the dropdown is to not load so many images in it. It is better to use HEX values for the names or strings, e.g.


<tool name="ApplyBackColor" type="dropdown" ItemsPerRow="10" popupheight="120px">
      <item  name="black" value="#000000"/>
      <item  name="white" value="#ffffff"/>
      <item  name="red" value="#ff0000"/>
      <item  name="#ff00ff" value="#ff00ff"/>
...


Kind regards,
Rumen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Kriengsak Multongjard
Top achievements
Rank 1
answered on 05 Jan 2011, 08:10 AM
Thanks Rumen,
Your suggestion works, but users would not be comfortable with color name/code displayed in the picker dropdown. Is there someway we can render the color instead of just display the name/code. (also keeping in mind performance-i.e. avoid using icons)?

Thanks and Regards,
Kriengsak.
0
Rumen
Telerik team
answered on 07 Jan 2011, 01:25 PM
Hi Kriengsak,

It is odd because the ColorPicker dropdown renders the colors and it is not needed to provide an image which represent the image color. You can see in the Server-Side example of RadEditor that the custom added colors are rendered.

Here is a video demonstrating my test: http://screencast.com/t/03QgVfyruba.

Kind regards,
Rumen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Kriengsak Multongjard
Top achievements
Rank 1
answered on 12 Jan 2011, 05:54 AM
Thanks Rumen.
I saw the demo. Is there someway we can specify which tool the color should be added?
ex: In our scenario, we have added a custom toolbar item named "ApplyBackColor" and we want to add specific colors to this toolbar item only. (not in forecolor/backcolor).

Thanks and Regards,
0
Rumen
Telerik team
answered on 13 Jan 2011, 03:02 PM
Hi Kriengsak,

The provided solution applies only to the built-in RadEditor's ForeColor and BackColor dropdowns. You can see how to implement custom tools in the following live demo: Custom Dropdowns.

In your custom dropdown scenario you can use the following syntax:


<tool name="ApplyBackColor" Name="ApplyBackColor"  type="SplitButton" ItemsPerRow="5" PopupWidth="170px" PopupHeight="117px">
    <item  name="<div style='background-color:red;'> </div>"  value="icons/1.gif"  />
    <item  name="<div style='background-color:green;'> </div>"  value="icons/2.gif"  />
    <item  name="<div style='background-color:blue;'> </div>"  value="icons/3.gif"  />
</tool>


All the best,
Rumen
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Editor
Asked by
Kriengsak Multongjard
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Kriengsak Multongjard
Top achievements
Rank 1
Share this question
or