This error i get, couse i did not clear my cache. But i am pretty sure that I’m doing something wrong, i’m weak in ExtJS. And I need help to move the right way.
Firstly, here is my console.window.js file, which i load in my controller.
var topic = '/generateinfo/';
var register = 'mgr';
var console = MODx.load({
xtype: 'modx-console'
, register: register
, topic: topic
, show_filename: 0
, listeners: {
'shutdown': {
fn: function () {
/* do code here when you close the console */
}, scope: this
}
}
});
console.show(Ext.getBody());
MODx.Ajax.request({
url: generateInfo.config.connector_url
, params: {
action: 'mgr/generateinfo'
, register: register
, topic: topic
}
, listeners: {
'success': {
fn: function () {
console.fireEvent('complete');
}, scope: this
}
}
});
And here is my processor, generateinfo
class generateInfoProcessor extends modObjectProcessor
{
public function process()
{
$modx->log(modX::LOG_LEVEL_INFO,'An information message in normal colors.');
$modx->log(modX::LOG_LEVEL_ERROR,'An error in red!');
$modx->log(modX::LOG_LEVEL_WARN,'A warning in blue!');
}
}
return 'generateInfoProcessor';
I want to understand, how i can call console with this logs…
Because the request to the connector contains a topic and register parameter, the request automatically enables the register logging (modRequest.registerLogging(), called in modManagerRequest.loadErrorHandler()) which means log messages are automatically written to where the console will read from.
I’m guessing the JS error you see comes from the lack of a response in the process() method. You should end it with return $this->success('Optional Success Message');
Your calls to $modx->log should also be $this->modx->log as you’re in a class.
Try wrapping the code you posted before (which has the MODx.load({}) ) in a function, and calling that function in the handler. Or is that already your MODx.generateinfo ?