1. #1
    Sencha Premium Member
    Join Date
    Nov 2013
    Posts
    22
    Vote Rating
    0
    rolzan is on a distinguished road

      0  

    Question Unanswered: Add a sencha button to a HTML element

    Unanswered: Add a sencha button to a HTML element


    Hello,

    i am retrieving HTML via JSON, this HTML is shown in a detailCard of a nested List:
    Code:
    detailCard.setHtml(... ....)
    In the retrieved HTML there is a div:
    HTML Code:
    <div id="ColorButtonContainer">
    Is it possible to add a sencha button to this div?

    I have created a sencha button:
    Code:
    var colorButton = Ext.create('Ext.Button', {
        id: 'colorButton',
        text: 'Paint it !!!',
        handler: function () {
            Ext.Ajax.request({
                
                url: 'http://10.14.10.36/gdlibrary/scripts/paintit.php',
                data: 'Bild1=resources/images/..... . . . . .',
                //defaultHeaders : 'application/json',
                method: 'POST',
                success: function(xhr) {
                    var response = Ext.decode(xhr.responseText);
                    console.dir(response);
                }
            });
        }
    });
    But how to add this button to the div element?

    Thanks in advance
    Best regards
    Rolf

  2. #2
    Sencha Premium Member
    Join Date
    Nov 2013
    Posts
    22
    Vote Rating
    0
    rolzan is on a distinguished road

      0  

    Question


    I have tried the get method - but Ext.get("ColorButtonContainer") is null.

  3. #3
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,967
    Answers
    334
    Vote Rating
    133
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    Use the button renderTo config and render it to the div
    http://docs.sencha.com/touch/2.3.1/#...t-cfg-renderTo
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

Thread Participants: 1