where is GridView.onRemove ? - Ext JS

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
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);
}
but i can't find GridView.OnRemove method, this is a bug or not completed
sorry for my english
Reply With Quote
  #2  
Old 02-20-2007, 07:35 AM
Default

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).
Reply With Quote
  #3  
Old 02-20-2007, 09:05 AM
Default

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);
    }
ds.remove method delete record, then fire GridView.onRemove
onRemove : function(ds, record, isUpdate){
        var index = typeof record == "number" ? record : this.ds.indexOf(record);
        ...
    }
index always be -1 because record is deleted
Reply With Quote
  #4  
Old 02-20-2007, 10:02 AM
Default

I redeployed - check the new version.
Reply With Quote
  #5  
Old 02-22-2007, 10:21 AM
Default

same function name problem in View.js (onDelete vs. onRemove)

Also, there are references to
this.ds
It should be
this.store
now, right ?



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);
    }
Reply With Quote
  #6  
Old 02-22-2007, 06:28 PM
Default

Thanks, I put in your fixes.
Reply With Quote
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值