Users Pricing

forum

Home Forums How can we reload store and refresh grid on button click in following code? – MindStick

How can we reload store and refresh grid on button click in following code?

Simond Gear 1676 17 Feb 2017

How can we reload store and refresh grid on button click in following code?

updateClick:
function (field,
newValue, oldValue) {  //updateClick function call on update button click
        console.log(field);
        var me = this;
        var form = Ext.getCmp('userForm'); //get component of userForm and assign value into form variable
        var values = form.getValues(); //call getValue function by association of form variable and assign into values variable
        Ext.Ajax.request({     //send Ajax request to MVC controller request
            url: './User/Update',   //give path of method define in MVC controller
            method: 'POST',     //use POST method
            jsonData: values,   //send values in the form of jsonData
            success: function (response) {      //define success function
                var result = Ext.decode(response.responseText);
                if (result.success === true) {
                    Ext.Msg.show({
                        title: 'EMPLOYEE',
                        msg: result.message,
                        buttons: Ext.Msg.OK,
                        icon:Ext.MessageBox.INFORMATION
                    });
                }
                else {
                    Ext.Msg.show({
                        title: 'EMPLOYEE',
                        msg: result.message,
                        buttons: Ext.Msg.OK,
                        icon:Ext.MessageBox.ERROR
                    });
                }
            },
            failure: function () {  //define failure function on response of mvc controller
                Ext.Msg.show({
                    title: 'Record not Updated',
                    msg: result.message,
                    buttons: Ext.Msg.OK,
                    icon: Ext.MessageBox.ERROR
                });
            }
        });
    },

1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md