1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    7
    Vote Rating
    1
    Luis Miguel is on a distinguished road

      0  

    Default Button action-connection with Arduino

    Button action-connection with Arduino


    Hello,

    I am currently doing a poject with Arduino and I am making an user interface with Sencha Architect. I have to edit the button action with this code:


    items: [ {
    xtype: 'button',
    ui: 'confirm',
    text: 'LUZ 1 ON'
    handler: function(button, event){
    Ext.Ajax.request({
    method: 'GET',
    url: 'http://PUT ARDUINO IP/LUZ1ON',
    useDefaultXhrHeader: false,
    disableCaching: false }); }

    },

    However I can not add the red color code in Sencha Architect. Could someone tell me how I can get this code in Sencha Architect? Thank you very much.

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,226
    Vote Rating
    121
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Quote Originally Posted by Luis Miguel View Post
    However I can not add the red color code in Sencha Architect. Could someone tell me how I can get this code in Sencha Architect? Thank you very much.
    Choose the button in the inspector. In the bottom right config pane search for "handler", click the + button to the right of it. Click the -> arrow to drill down into the function. Do your Ext.Ajax.request; notice the function has already been created/closed.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    Jan 2013
    Posts
    7
    Vote Rating
    1
    Luis Miguel is on a distinguished road

      0  

    Default


    Thank you very much. I didn't see "handler" in the config pane.

Thread Participants: 1