OnClientClick event missing

2 posts, 0 answers
  1. Jon
    Jon avatar
    813 posts
    Member since:
    Oct 2008

    Posted 09 Jul 2015 Link to this post

    Hi,

    I've tried to get the OrgChart working and have had quite a few issues.  I've had to build my own container to cope with scrolling as by default it doesn't allow for a container or zoom mechanisms.  I'm now trying to do one more simple thing of having a client click event so that I can link to a record on the chart.  I could never have imagined on having to ask for such a basic bit of functionality.

    There is no click event and you have to do a work around. But the code that I have seen doesn't work as the Id that comes back is set to an empty string, the adapted code is below my rant.

    Every time I work with something new I seem to be spending more time on getting it working than I should, everything needs a work around or another.  The point of a control suite like this one is so that people don't need to do work arounds.  Even more frustrating is the need to vote for good functions when they are suggested, just add them in!

    So, please, someone from Telerik tell me how to do an onclick properly and then tell me that a proper onclick handler will be introduced in the next version.  I suppose that this is the price to pay for the fact that all new controls are simply KendoUI controls re-engineered for ASP.NET?

    Regards

    Jon

    $telerik.$(".rocItem").click(function (e) {
        var orgChart = $find("<%= uxRadOrgChart.ClientID%>");
        var index = orgChart._extractGroupItemFromDomElement(e.target).getId();
    })

     

     

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    837 posts

    Posted 14 Jul 2015 Link to this post

    Hello Jon,

    We are gradually adding new features and functionality to our controls, including ones that are not requested in our feedback portal. The voting system is convenient because it helps in prioritizing and planning the addition of the new features.

    Some of the controls in the ASP.NET AJAX suite are based on KendoUI controls but they are a minority.

    RadOrgChart's purpose is to represent the structure of an organization and visualize the relationships between its members and as you have found out it does not have a node click handler. The approach using jQuery you posted in your first reply is the correct one if you want to handle a click.

    Instead of getting the id which is not set and will return an empty string you could get the GroupItem's index (get_index()) or text as shown below:
    $telerik.$(".rocItem").click(function (e) {
     
        var orgChart = $find("<%= RadOrgChart1.ClientID%>");
        var text = orgChart._extractGroupItemFromDomElement(e.target)._element.innerText;
    });

    Regarding RadOrgChart zooming, please find linked the OrgChart - Structure Zooming demo.

    Regards,
    Ivan Danchev
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top