Changes between Initial Version and Version 1 of Ticket #7474


Ignore:
Timestamp:
Aug 20, 2008, 1:15:15 PM (13 years ago)
Author:
bill
Comment:

I wouldn't call this a regression... it's just that (IIUC) the operation you are talking about now needs to be done on the data stores feeding the new grid and old grid, specifically creating a new item (in the target table) and deleting the old item (in the source table).

You shouldn't be looking at an item directly; access it through the store's interface. On your old store, do getAttributes() and then loop through each attribute and getValue(item, attribute), constructing a new item to insert into the new store.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7474 – Description

    initial v1  
    22
    33Example:[[BR]]
    4 var s = leftGrid.selection.getSelected();[[BR]]
    5 if(s.length) {[[BR]]
    6     rightGrid.beginUpdate();[[BR]]
    7     for (var i = 0; i < s.length ; i++) {[[BR]]
    8         rightGrid.addRow(leftGrid.model.getRow(s[i]));[[BR]]
    9     }[[BR]]
    10     rightGrid.endUpdate();[[BR]]
    11 [[BR]]   
    12     leftGrid.model.remove(s);[[BR]]
    13     leftGrid.selection.clear();[[BR]]
    14 }[[BR]]
     4{{{
     5var s = leftGrid.selection.getSelected();
     6if(s.length) {
     7    rightGrid.beginUpdate();
     8    for (var i = 0; i < s.length ; i++) {
     9        rightGrid.addRow(leftGrid.model.getRow(s[i]));
     10    }
     11    rightGrid.endUpdate();
    1512
     13    leftGrid.model.remove(s);
     14    leftGrid.selection.clear();
     15}
     16}}}
    1617With Grid 1.2 the model is gone, but also the getRow and addRow methods. Instead, selection.getSelected() returns a array of the underlying datastore. The problem is, that the returned data format of selection.getSelected() now depends on the specific (!) datastore implementation.
    1718