1

Help me ! i saved the qty successfully using ajax popup, but i want hide 2 button in popup

  1. Close
  2. Save

When you click the save button -> save When you click the save Close-> not save

My jquery ajax

url = '/admin/stocktaking/index/save';
                // ajax
                jQuery.ajax({
                    url: url,
                    dataType: 'json',
                    type : 'post',
                    data: {sku: sku,qty: stocktaking},
                    showLoader: true,
                    success: function(data) {
                        console.log(data);
                        if (stocktaking >= 0) {
                            if (data.success) {
                                //popup success
                                var popup = $('<div class="themecafe-free-popup"/>').html(data.success).modal({
                                    modalClass: 'changelog',
                                    buttons: [{
                                        text: 'Close',
                                        click: function () {
                                            this.closeModal();
                                        }
                                    },{
                                        text: 'Save',
                                        click: function () {
                                            location.href = "/admin/stocktaking/index/save";
                                            return false;
                                        }
                                    }]
                                });
                                popup.modal('openModal');
                                //end popup success
                                //popup error
                            } else if (data.error) {
                                var popup = $('<div class="themecafe-free-popup"/>').html(data.error).modal({
                                    modalClass: 'changelog',
                                    buttons: [{
                                        text: 'Close',
                                        click: function () {
                                            this.closeModal();
                                        }
                                    }]
                                });
                                popup.modal('openModal');
                                //end popup error
                            }
                        }
                    }
                });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.