Extjs 5 网格同步行呈现问题
Extjs 5 grid sync row render issues
使用 extjs 5.1.0
我的问题,当我将值添加到网格存储然后调用 store.sync()
插入的行变成 selected(视觉上)但我不能 select 它用于编辑或 darg&drop 行进行排序,只有助于重新加载网格。
这是我的商店:
var store = Ext.create('Ext.data.ArrayStore', {
model: 'pbxe.module.conference.ConferenceModel',
proxy: {
type: 'direct',
api: {
read: pbxe._conference.read,
create: pbxe._conference.create,
update: pbxe._conference.update,
destroy: pbxe._conference.destroy,
},
reader: {
rootProperty: 'data',
totalProperty: 'totalCount',
successProperty: 'success',
messageProperty: 'message'
},
writer: {
writeAllFields: true,
},
},
autoSync: false,
autoLoad: true,
});
我们 运行 遇到了同样的问题,似乎选择模型存在一个问题,即保留添加到商店的记录的映射,但无法获取 "deselected"。
所以用一点蛮力:
// WORKAROUND for grid / selection model problem
// after adding multiple new records with Store.sync()
//var grid = grid bound to this store...
myStore.sync(
{
scope: this,
success: function (batch, options) {
var sm = grid.getSelectionModel();
var records = batch.operations[0].getRecords();
if (sm && sm.selected)
{ // deselect does not work as has bug leaves new records in map
sm.selected.map = {}; //wipe clear the selected records map
}
sm.select(records);
}
});
希望这对我们有所帮助 - 适用于 Ext JS 5.1.0
使用 extjs 5.1.0 我的问题,当我将值添加到网格存储然后调用 store.sync() 插入的行变成 selected(视觉上)但我不能 select 它用于编辑或 darg&drop 行进行排序,只有助于重新加载网格。
这是我的商店:
var store = Ext.create('Ext.data.ArrayStore', {
model: 'pbxe.module.conference.ConferenceModel',
proxy: {
type: 'direct',
api: {
read: pbxe._conference.read,
create: pbxe._conference.create,
update: pbxe._conference.update,
destroy: pbxe._conference.destroy,
},
reader: {
rootProperty: 'data',
totalProperty: 'totalCount',
successProperty: 'success',
messageProperty: 'message'
},
writer: {
writeAllFields: true,
},
},
autoSync: false,
autoLoad: true,
});
我们 运行 遇到了同样的问题,似乎选择模型存在一个问题,即保留添加到商店的记录的映射,但无法获取 "deselected"。
所以用一点蛮力:
// WORKAROUND for grid / selection model problem
// after adding multiple new records with Store.sync()
//var grid = grid bound to this store...
myStore.sync(
{
scope: this,
success: function (batch, options) {
var sm = grid.getSelectionModel();
var records = batch.operations[0].getRecords();
if (sm && sm.selected)
{ // deselect does not work as has bug leaves new records in map
sm.selected.map = {}; //wipe clear the selected records map
}
sm.select(records);
}
});
希望这对我们有所帮助 - 适用于 Ext JS 5.1.0