i remove a record in grid using ds.remove(record) method
but can't remove record with the same error:
l.fireFn has no properties
GridView.js
but i can't find GridView.OnRemove method, this is a bug or not completed
sorry for my english
but can't remove record with the same error:
l.fireFn has no properties
GridView.js
if(ds){
ds.on("datachanged", this.onDataChange, this);
ds.on("add", this.onAdd, this);
ds.on("remove", this.onRemove, this);
ds.on("update", this.onUpdate, this);
ds.on("clear", this.onClear, this);
}

sorry for my english


|
#2
|
|
It's a bug, the function is there but it's called "onDelete". I renamed onDelete to onRemove and all is well (also a change in onUpdate where it calls onDelete).
![]() |
|
#3
|
|
i rename onDelete to onRemove,but there is another bug
Store.js remove : function(record){
var index = this.data.indexOf(record);
this.data.removeAt(index);
this.fireEvent("remove", this, record, index);
}
onRemove : function(ds, record, isUpdate){
var index = typeof record == "number" ? record : this.ds.indexOf(record);
...
}
![]() |
|
#4
|
|
I redeployed - check the new version.
![]() ![]() |
|
#5
|
|
same function name problem in View.js (onDelete vs. onRemove)
Also, there are references to this.ds this.store onDelete : function(ds, record){
this.clearSelections();
var index = this.ds.indexOf(record);
this.el.dom.removeChild(this.nodes[index]);
this.updateIndexes(index);
}
onUpdate : function(ds, record){
this.clearSelections();
var index = this.ds.indexOf(record);
var n = this.nodes[index];
this.tpl.insertBefore(n, this.prepareData(record.data));
n.parentNode.removeChild(n);
this.updateIndexes(index, index);
}
![]() |
|
#6
|
|
Thanks, I put in your fixes.
![]() |
本文讨论了在使用GridView组件时遇到的一个Bug,即无法通过ds.remove方法正确删除记录。问题在于GridView组件中移除记录的方法名不匹配,并且在删除记录后获取索引存在问题。通过更改方法名和调整索引获取逻辑,最终解决了这个问题。


被折叠的 条评论
为什么被折叠?



