Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var buttons = new Array({
- label: 'Salvar',
- type: 'success',
- autoClose: false
- }, {
- label: 'Fechar',
- type: 'default',
- autoClose: true
- });
- MyDataTable.openModal('modalEdit', title, MyDataTable.modalHtml, 'full', buttons);
- --------------------------------
- openModal: function (id, title, content, size, buttons) {
- this.size = ((size == undefined) ? 'large' : size); //NOTE: full | large | small
- this.actions = new Array();
- if (buttons != null && buttons.length > 0) {
- for (var i = 0; i < buttons.length; i++) {
- this.actions.push({
- 'label': buttons[i].label,
- 'bind': 'data-open-' + (buttons[i].label.replace(' ', '-')).toLowerCase(),
- 'classType': 'btn-' + buttons[i].type,
- 'autoClose': buttons[i].autoClose
- });
- }
- } else if (buttons != null) {
- this.actions.push({
- 'label': 'Cancelar',
- 'bind': 'data-open-cancelar',
- 'classType': 'btn-danger',
- 'autoClose': true
- });
- } else {
- this.actions.push({
- 'label': 'Fechar',
- 'bind': 'data-open-fechar',
- 'classType': 'btn-primary',
- 'autoClose': true
- });
- }
- if (_global.modal[id] != undefined) {
- _global.modal[id].remove();
- }
- _global.modal[id] = FLUIGC.modal({
- title: title,
- content: content,
- id: 'fluig-modal',
- size: this.size,
- actions: this.actions
- }, function (err, data) {
- if (err) {
- // do error handling
- } else {
- // do something with data
- }
- });
- },
Advertisement
Add Comment
Please, Sign In to add comment