Update text shape from Diagram-app sample

3 posts, 0 answers
  1. Paulo
    Paulo avatar
    10 posts
    Member since:
    May 2014

    Posted 27 Jul 2015 Link to this post

    I am using the Diagram-app sample to build my application. I need add option to change text from Shape.

     

    I added the code:

     

    <div class="configRow">
        <label class="configLabel">Texto</label>
        <div class="configControlContainer">
            <telerik:RadTextBox ID="shapeText" runat="server" EnabledStyle-HorizontalAlign="Right" MaxLength="50" MinValue="0" Width="110px">
                <ClientEvents OnBlur="updateShapeText" />
            </telerik:RadTextBox>
        </div>
    </div>

     

    But the client function "updateShapeText"​ not work !!!

     

     function updateShapeText(sender, args) {

            if (skipShapeConfigEvent) {
                return true;
            }
            var diagram = getDiagram();
            selection = diagram.select();

            selection[0].shapeVisual.options.content.text = sender.get_value();
        }​

     

    Could you help me ?

  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 29 Jul 2015 Link to this post

    Hi Paulo,

    I suggest using the same logic used for updateShapeStrokeColor method:

    function updateShapeText(sender, args) {
        updateSelectedShapes({ content: { text: sender.get_value() } });
    }


    Regards,
    Ianko
    Telerik
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paulo
    Paulo avatar
    10 posts
    Member since:
    May 2014

    Posted 29 Jul 2015 in reply to Ianko Link to this post

    Thank worked.
Back to Top