Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Editing data in listgrid while also using paging

    Hi,

    I have following use case: a user wants to edit a lot of records in a list grid. To do this, the user uses the arrow-down key to move to the next record (and he will do this multiple times). The next record will be put automatically in edit mode. The problem now is that if, due to paging, new records have to be fetched server-side, the grid exits the edit-mode automatically. Is there a way to keep the record in edit mode when new data is fetched for paging and when the user uses the arrow-down key or any other key to go to the next record.


    SmartClient Version: v11.1p_2017-12-23/PowerEdition Deployment (built 2017-12-23)
    Browsers: Chrome (70.0.3538.102) and Firefox (63.0.3)


    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.rpc.RPCManager;
    import com.smartgwt.client.types.PromptStyle;
    import com.smartgwt.client.widgets.Canvas;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.grid.ListGridField;
    import com.smartgwt.client.widgets.grid.ListGridRecord;
    import com.google.gwt.core.client.EntryPoint;

    public class GridDataPagingSample implements EntryPoint {
    public void onModuleLoad() {
    RPCManager.setPromptStyle(PromptStyle.CURSOR);
    ​​​​​​​ DataSource dataSource = ContentDS.getInstance();

    ​​​​​​​ ListGridField field1 = new ListGridField("field1", 100);
    ​​​​​​​ field1.setCanEdit(true);
    ​​​​​​​ ListGridField field2 = new ListGridField("field1", 100);
    ​​​​​​​ field2.setCanEdit(true); final ListGrid listGrid = new ListGrid();
    ​​​​​​​ listGrid.setWidth100();
    ​​​​​​​ listGrid.setHeight100();
    ​​​​​​​ listGrid.setMinFieldWidth(80);
    ​​​​​​​ listGrid.setAutoFetchData(true);
    ​​​​​​​ listGrid.setDataPageSize(50);
    ​​​​​​​ listGrid.setDataSource(DataSource.getDataSource("content"));
    ​​​​​​​ listGrid.setFields(field1, field2);
    ​​​​​​​ listGrid.draw();
    }

    @Override protected boolean isTopIntro() {
    ​​​​​​​ return true;
    ​​​​​​​ }
    }


    Kind regards,
    Brecht De Meulenaere

    #2
    We can't run this sample because you haven't included your "content" DataSource. Can you provide a standalone repro case we can run? Perhaps you can modify one of the SGWT Showcase samples? Also, why are you adding two fields with the same name to your grid?

    Note that we do see an issue with editing stopping during paging with the Live Grid SGWT LGPL sample, but in that case it's due to fields being present that define a displayField, but no valueField - which is not what you do in your sample.

    Comment

    Working...
    X