-
29 Jul 2012 3:13 AM #1
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
-
29 Jul 2012 10:12 PM #2
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.
-
30 Jul 2012 11:31 AM #3
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!


Reply With Quote