0

I followed the official tutorial explaining how to create personal plugin with openGeo client sdk but unfortunately I couldn't perform that task.
In the beggining, I "copy/ past" the code as it mentioned in the tutorial but my browser told me that gxp is not defined after that I make changes as follows:

/**
*
* @require plugins/Tool.js
*/

/** api: (extends)
*  plugins/Tool.js
*/

Ext.namespace("gxp.plugins");
//Ext.ns("carta.plugins");

gxp.plugins.DrawBox = Ext.extend(gxp.plugins.Tool, {
ptype: "gxp_drawbox",
addActions: function(){
    return gxp.plugins.DrawBox.superclass.addActions.apply(this, [{
        text: "Draw box"
    }]);
}
});

Ext.preg(gxp.plugins.DrawBox.prototype.ptype, gxp.plugins.DrawBox);  

Then, when I examine the code with chrome I receive this error:

Uncaught TypeError: Cannot read property 'prototype' of undefined ext-base.js:7
Ext.apply.extend ext-base.js:7
(anonymous function)

Do you have any hints about resolving this problem?

0

The SDK is not very forgiving when parsing the @require directives. Make sure that each @require line starts with blank-star-blank, and not just with star-blank.

  • oh great !!! I should start with blank-start-blank thank you the problem is resolved – jabrane Jun 4 '13 at 4:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.