[Vtigercrm-developers] How to get result of app.showModalWindow?

Alan Lord alanslists at gmail.com
Thu Oct 29 14:24:48 GMT 2015


I have some js code.

> AppConnector.request(params).then(
>                         function(data) {
>                             var callBackFunction = function(response) {
>                                 console.log(response);
>                                 jQuery(el).val('');
>                                 if(jQuery(el).prop("readonly")) {
>                                     jQuery(el).prop("readonly", false);
>                                 }
>                             }
>
>                             if(data['success']) {
> 	                            progressIndicatorElement.progressIndicator({'mode' : 'hide'});
> 	                            //TODO We're good to go so resume/restart the Validation Engine
> 	                           // event.currentTarget().trigger('click'); // Not right but the kind of idea...
>                             } else {
>                    				progressIndicatorElement.progressIndicator({'mode' : 'hide'});
>                    				// So there is at least one duplicate number.
>                    				// Know if they click OK/Cancel?
> 		                        app.showModalWindow(data['error']['code'], function(response) {
> 		                            console.log("In showModalWindow");
> 		                            console.log(response);
> 		                        	callBackFunction(response)
> 		                            // Something?
> 		                        });
>                             }
>                         },

What I need to do is to return to my callBackFunction whether the user 
clicked on the OK or Cancel in the modalPopup...

TIA

Al



More information about the vtigercrm-developers mailing list