Skip to content

Instantly share code, notes, and snippets.

@jmertic
Created July 30, 2014 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmertic/aa4147c34ffd8341cca8 to your computer and use it in GitHub Desktop.
Save jmertic/aa4147c34ffd8341cca8 to your computer and use it in GitHub Desktop.
pm-record-logic.js for this blog post http://wp.me/p419c4-2SB
({
className: 'pm-record-logic tcenter',
initialize: function(options) {
this._super("initialize", arguments);
this.context.on('button:pm_record_reports:click', this.pmRecordReports, this);
},
pmRecordReports: function() {
var object_id = this.model.get('id');
var object_name = this.model.attributes._module;
app.api.call('GET', app.api.buildURL('PM_ProcessManager/' + object_id + '/record_reports/' + object_name), null, {
success: function(data) {
app.drawer.open({
layout:'pm-record-reports',
context:{
PM_Data: data
}
});
},
error: function(error) {
app.alert.show("server-error", {
level: 'error',
messages: 'ERR_GENERIC_SERVER_ERROR',
autoCLose: false
});
app.error.handleHttpError(error);
}
});
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment