---
title: "How can we reload store and refresh grid on button click in following code?"  
description: "How can we reload store and refresh grid on button click in following code?"  
author: "Simond Gear"  
published: 2017-02-17  
updated: 2017-02-17  
canonical: https://www.mindstick.com/forum/34260/how-can-we-reload-store-and-refresh-grid-on-button-click-in-following-code  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# How can we reload store and refresh grid on button click in following code?

How can we [reload](https://www.mindstick.com/forum/224/title-reload-assembly-to-extend-with-new-types) [store](https://www.mindstick.com/articles/13125/tips-to-increase-sales-of-your-woocommerce-store) and [refresh](https://www.mindstick.com/forum/12865/how-to-refresh-dropdownlist-but-keep-old-selected-value-json) [grid](https://www.mindstick.com/forum/369/how-can-i-add-a-column-name-to-my-grid) on [button click](https://www.mindstick.com/forum/790/form-gets-submiited-twice-on-button-click) in following [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii)?\

```
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                });            }        });    },
```

## Replies

### Reply by Hemant Patel

### *You can use following code under success function*

```
  var store = Ext.getCmp('userGridFooter').getStore();                    store.reload();                    Ext.getCmp('userGridFooter').getView().refresh();
```

\

## *Your 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 ssign 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) {  //window.location.reload();                    var store = Ext.getCmp('userGridFooter').getStore();                    store.reload();                    Ext.getCmp('userGridFooter').getView().refresh();                    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                });            }        });    },
```


---

Original Source: https://www.mindstick.com/forum/34260/how-can-we-reload-store-and-refresh-grid-on-button-click-in-following-code

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
