| 650 | | record = store.getAt(id).copy(); |
|---|
| 651 | | |
|---|
| 652 | | layer = record.get("layer"); |
|---|
| | 650 | /** |
|---|
| | 651 | * If the same layer is added twice, it will get replaced |
|---|
| | 652 | * unless we give each record a unique id. In addition, we |
|---|
| | 653 | * need to clone the layer so that the map doesn't assume |
|---|
| | 654 | * the layer has already been added. Finally, we can't |
|---|
| | 655 | * simply set the record layer to the cloned layer because |
|---|
| | 656 | * record.set compares String(value) to determine equality. |
|---|
| | 657 | * |
|---|
| | 658 | * TODO: suggest record.clone |
|---|
| | 659 | */ |
|---|
| | 660 | Ext.data.Record.AUTO_ID++; |
|---|
| | 661 | record = store.getAt(id).copy(Ext.data.Record.AUTO_ID); |
|---|
| | 662 | layer = record.get("layer").clone(); |
|---|
| | 663 | record.set("layer", null); |
|---|
| | 664 | record.set("layer", layer); |
|---|