0

我有一个网格,第一列是一个复选框,我需要标记复选框,但是当我加载我的网格时,有时复选框会被选中,有时不会被选中,有人可以帮助我吗?

            var item = record.data;
            grid.store.load({
            callback: function(response){
                Ext.each(response, function(records) {
                    Ext.each(item.links, function (valor){
                        if(records.data.id == valor.id){
                          var row = records.index;
                          grid.getSelectionModel().select(row);
                        }
                    });
                });
            }
        });
        form.loadRecord(record);
4

1 回答 1

0

Problem solved with event beforerefresh. Thanks for all.

            var item = record.data;
            grid.store.load({
            callback: function(response){
                grid.getView().on('beforerefresh', function(view) {
                    Ext.each(response, function(records) {
                        Ext.each(item.links, function (valor){
                            if(records.data.id == valor.id){
                              var row = records.index;
                              grid.getSelectionModel().select(row, true);

                            }
                        });
                    });
                });
            }
        });
        form.loadRecord(record);
于 2012-11-09T13:17:26.343 回答