grid.reload
时间: 2023-10-25 08:35:48 浏览: 42
As an AI language model, I am not certain which specific technology or software you are referring to when you mention "grid". However, in general terms, "grid.reload" could refer to a command or function that reloads or refreshes data or content displayed in a grid or table format. This could be useful in situations where the data being displayed has been updated or modified and needs to be reloaded to reflect the changes.
相关问题
写一个extjs6使用 Store.reload()的完整例子
Ext.define('MyApp.view.MyGrid', {
extend: 'Ext.grid.Panel',
xtype: 'mygrid',
store: {
type: 'mystore'
},
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email' },
{ text: 'Phone', dataIndex: 'phone' }
],
tbar: [{
text: 'Reload Store',
handler: function() {
var store = this.up('grid').getStore();
store.reload();
}
}]
});
Ext.define('MyApp.store.MyStore', {
extend: 'Ext.data.Store',
alias: 'store.mystore',
fields: [
'name', 'email', 'phone'
],
data: [
{ name: 'Lisa', email: 'lisa@simpsons.com', phone: '555-111-1224' },
{ name: 'Bart', email: 'bart@simpsons.com', phone: '555-222-1234' },
{ name: 'Homer', email: 'homer@simpsons.com', phone: '555-222-1244' },
{ name: 'Marge', email: 'marge@simpsons.com', phone: '555-222-1254' }
]
});
找出下列代码的错误点 var store = me.Store_BPMDATA_AdmissionFee_M; var ids=[]; var grid = me.Grid_BPMDATA_AdmissionFee_M; var recs = grid.getSelectionModel().getSelection(); debugger; Ext.Msg.show( { title: '同步数据', //msg: '您确定要删除选中项吗?', buttons: Ext.Msg.OK, //buttons: Ext.Msg.OKCANCEL, defaultFocus: 'OK', //defaultFocus: 'cancel', //icon: Ext.MessageBox.INFO, fn: function (btn, text) { YZSoft.Ajax.request( { url: YZSoft.$url(me, 'YZModules/RenewalPayment.ashx'), method: 'POST', params: { method: 'ProcessRequest' }, jsonData: , success: function (action) { var rv = ""; debugger; store.reload(); }, failure: function (action) { var rv = action.result.errorMessage; Ext.Msg.alert("提示", "通知操作失败,请联系管理员!" + rv) } }); } });
代码中有一个语法错误,即 `jsonData: ,` 这一行。应该在 `jsonData:` 后面加上一个空对象 `{}`,表示传递一个空的 JSON 对象。修改后的代码如下:
```javascript
var store = me.Store_BPMDATA_AdmissionFee_M;
var ids=[];
var grid = me.Grid_BPMDATA_AdmissionFee_M;
var recs = grid.getSelectionModel().getSelection();
debugger;
Ext.Msg.show({
title: '同步数据',
//msg: '您确定要删除选中项吗?',
buttons: Ext.Msg.OK,
//buttons: Ext.Msg.OKCANCEL,
defaultFocus: 'OK',
//defaultFocus: 'cancel',
//icon: Ext.MessageBox.INFO,
fn: function (btn, text) {
YZSoft.Ajax.request({
url: YZSoft.$url(me, 'YZModules/RenewalPayment.ashx'),
method: 'POST',
params: {
method: 'ProcessRequest'
},
jsonData: {}, // 修复语法错误
success: function (action) {
var rv = "";
debugger;
store.reload();
},
failure: function (action) {
var rv = action.result.errorMessage;
Ext.Msg.alert("提示", "通知操作失败,请联系管理员!" + rv)
}
});
}
});
```
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)