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

Remove TagCloudItem

1 Answer 46 Views
TagCloud
This is a migrated thread and some comments may be shown as answers.
Iason Demiros
Top achievements
Rank 1
Iason Demiros asked on 04 Aug 2011, 11:55 AM

I have a question about removing a RadTagCloudItem. I have a TagCloud and i want it to behave like most clouds. For example, if i don't like a word in the cloud i want to right-click on the word and select from a pop-up menu remove it. And the word will be removing from the cloud i see(Client-side).

I have tried to click on the word i don't want and in server-side removing it, but it's very slow and it's not what i want. Because it's not obvious for someone else to click on the word in order to remove it.

Any propose?

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 09 Aug 2011, 02:58 PM
Hi Iason,

If I understand you correctly, you want the user to be able to remove items from the TagCloud. Unfortunately, RadTagCloud's client-side API does not offer the required functionality at this point. To achieve the required result you can handle the RadTagCloud's ClientLoad event and manually handle the right click, e.g.:
<telerik:RadTagCloud ID="RadTagCloud1" runat="server" OnClientLoad="OnClientLoad">
    <Items>
        <telerik:RadTagCloudItem Text="text1" Weight="1" />
        <telerik:RadTagCloudItem Text="text2" Weight="2" />
        <telerik:RadTagCloudItem Text="text3" Weight="3" />
        <telerik:RadTagCloudItem Text="text4" Weight="4" />
    </Items>
</telerik:RadTagCloud>
 
<script type="text/javascript">
    function OnClientLoad(tagCloud, args)
    {
        var items = tagCloud.get_items();
        for (var i = 0; i < items.length; i++)
        {
            var itemElem = items[i].get_element();
            $addHandler(itemElem, "mousedown", rightClickHandler);
        }
    }
</script>

For your convenience I have attached a sample page implementing this approach.


Kind regards,
Dobromir
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
TagCloud
Asked by
Iason Demiros
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or