Ext store里的记录如何修改?

最近有个需求,grid表格可以行拖拽,拖拽以后要修改store中的记录,并保存到数据库。拖拽没有问题但是总是无法修改store中的记录。请问如何解决?

代码片段如下 注:代码是可以运行的 。这里只是片段,我的问题是 为何修改了store,但是已修改集合的长度确实0?

[code="java"]
initRowDragDrop:function(){
var store=this.store;
var drapDrop=new Ext.dd.DropTarget(grid.container, {
ddGroup : 'GridDD',
copy : false,
notifyDrop : function(dd, e, data) {
//拖拽代码开始 拖拽部分没有问题
// 选中了多少行
var rows = data.selections;
// 拖动到第几行
var index = dd.getDragData(e).rowIndex;
if (typeof(index) == "undefined") {
return;
}

                        var rowData = rows[0];

                        if (!this.copy) store.remove(rowData);

                        store.insert(index, rowData);
                        //拖拽结束  

                        //开始修改store   
                        for(var i=0;i<store.getCount;i++)  {
                             //修改记录中的字段值
                            store.getAt(i).set("priority",i);
                            //提交修改
                            store.commitChanges();
                        }

                        //获取有更改的记录集合
                        var modifyed=store.getModifiedRecords();

                      //[b]打印集合长度  问题? 总是0 说明没有做任何更改。  这是怎么回事 ?[/b]                            

                       alert(modifyed.length);


                  }
              });

}
[/code]

API上的话:
getModifiedRecords() : Ext.data.Record[]
获得最后一次提交之后被修改的记录...

store.commitChanges(); 所以。。。它如何能不是0