1. #1
    Sencha User
    Join Date
    Jul 2013
    Posts
    2
    Vote Rating
    0
    codin is on a distinguished road

      0  

    Default Simple Navigation View guide from sencha docs isn't working

    Simple Navigation View guide from sencha docs isn't working


    Hello,
    I am a beginner to sencha touch and am trying out the same on sencha architect Version: 2.2.2 Build: 991.
    and using the touch-2.2.1 library.

    I am trying to follow a walkthrough on Navigation View at
    http://docs.sencha.com/architect/2/#...navigationview

    After completing the tutorial I tried running the app,
    The step1panel displays right with the number field and a next button and all but nothing would happen on the next button click.

    I tried out various ways like adding ref etc but nothing works.

    No JavaScript errors on the chrome console panel and no warning msgs other than mime type (using sencha-touch-all-debug.js)

    My Controller code :

    Code:
    Ext.define('MyApp.controller.MainNavController', {
        extend: 'Ext.app.Controller',
    
    
        config: {
            control: {
                "step1": {
                    tap: 'onStep1SubmitTap'
                },
                "step2": {
                    tap: 'onStep2SubmitTap'
                },
                "step3": {
                    tap: 'onStep3SubmitTap'
                }
            }
        },
    
    
        onStep1SubmitTap: function(button, e, eOpts) {
            alert("button tapped");   // Doesnt show up
            button.up('navigationview').push({
                xtype: 'step2',
                title: 'Step 2'
            });
        },
    
    
        onStep2SubmitTap: function(button, e, eOpts) {
            button.up('navigationview').push({
                xtype: 'step3',
                title: 'Step 3'
            });
        },
    
    
        onStep3SubmitTap: function(button, e, eOpts) {
            var mainNav = button.up('navigationview'),
                num1 = mainNav.child('step1').getValues().number1,
                num2 = mainNav.child('step2').getValues().number2,
                operation = mainNav.child('step3').getValues().operation,
                result;
    
    
            switch (operation) {
                case 'add':
                result = num1 + num2;
                break;
                case 'subtract':
                result = num1 - num2;
                break;
                case 'multiply':
                result = num1 * num2;
                break;
                case 'divide':
                result = num1 / num2;
                break;
            }
    
    
            Ext.Msg.alert('Your result is: ' + result);
        }
    
    
    });

    And step1panel code :

    Code:
    Ext.define('MyApp.view.step1panel', {
        extend: 'Ext.form.Panel',
        alias: 'widget.step1',
    
    
        config: {
            items: [
                {
                    xtype: 'fieldset',
                    title: 'Enter a Number',
                    items: [
                        {
                            xtype: 'numberfield',
                            name: 'number1'
                        }
                    ]
                },
                {
                    xtype: 'button',
                    centered: false,
                    ui: 'forward',
                    text: 'Next'
                }
            ]
        }
    
    
    });


    PPPLLLEEASE help me out.

  2. #2
    Sencha User
    Join Date
    Jul 2013
    Posts
    2
    Vote Rating
    0
    codin is on a distinguished road

      0  

    Default Problem solved : Didn't set the control query properly

    Problem solved : Didn't set the control query properly


    hello guys,
    I missed out the button part while providing the control query.
    Just adding "step1 button" made it work.

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar