Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//custom-component.js
Path_To_Your_Bundle/Resources/public/js/app/components/your-component.js
define(function(require) {
'use strict';
var YourCustomComponent;
var BaseComponent = require('oroui/js/app/components/base/component');
var mediator = require('oroui/js/mediator');
var _ = require('underscore');
var $ = require('jquery');
YourCustomComponent = BaseComponent.extend({
/**
* @property {Object}
*/
options: {
buttonSelector: 'input[type=button]', //use jquery common selectors
},
/**
* @inheritDoc
*/
initialize: function(options) {
this.options = _.defaults(options || {}, this.options);
this.options._sourceElement
.on('change', this.buttonSelector, _.bind(this.onBtnClick, this));
},
onBtnClick: function() {
mediator.trigger('datagrid:doReset:attendance-contacts-grid');
}
return YourCustomComponent;
});
// in twig
<div data-page-component-module="path/to/your/component.js">
// widget content here
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.