1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    6
    Vote Rating
    0
    tah_206207 is on a distinguished road

      0  

    Default mapPanel topToolbar functions doesn't works

    mapPanel topToolbar functions doesn't works


    I use geoExt with ExtJs3.4 in my application!.I create a mapPanel and add openlayers map into it with below code.

    Code:
    var mapPanel = new GeoExt.MapPanel({
            renderTo: 'gxmap',
            height: 500,
            width: 800,
            map: map,
            title: 'Map'
        });
    after that i create extjs toggle button

    Code:
    var button = new Ext.Button({
    text: 'Measure Things',
    enableToggle: true,
    handler: function(toggled){
        if (toggled) {
            polygon.activate();
        } else {
            polygon.deactivate();
        }
    }
    });
    when i want to add this button to map panel i get topPanel of mapPanel and after that when i want to use topPanel functions these functions doesn't works!

    Code:
    mapPanel.getTopToolbar().addButton(button);
    or below code

    Code:
    topToolbar = mapPanel.getTopToolbar();
    topToolbar.addButton(button);
    when i see chrome developer tool i see this error for addButton function or other functions of topToolbar of panel! error:


    uncaught typeError: cannot call method 'addButton' of undefined
    why i can't use topToolbar functions?
    Link for tutorial of geoext that use mapPanel.getTToolbar().addButton(button);
    http://geoext.org/tutorials/control-...#extjs-buttons

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,332
    Vote Rating
    83
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default



    when i want to add this button to map panel i get topPanel of mapPanel and after that when i want to use topPanel functions these functions doesn't works!
    mapPanel.getTToolbar().addButton(button);
    or below code
    topToolbar = mapPanel.getTToolbar();


    HI!
    i guess, you are using wrong code to get toptoolbar
    it must be,
    Code:
    mapPanel.getTopToolbar().addButton(button);
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    6
    Vote Rating
    0
    tah_206207 is on a distinguished road

      0  

    Default Excuse

    Excuse


    Excuse me! this is type error
    i use mapPanel.getTopToolbar().addButton(button); but when i want to use getTopToolbar() functions doesn't work!
    chrome shows Error for getTopToolbar() functions!

Thread Participants: 1

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