Hi,
We have been using LinkItem as cell editor in ListGrid. The goal is to allow user pick a file through icon while text entry is blocked. This sample illustrates scenario and has been working fine in our production version based on 11.1p (SmartClient Version: v11.1p_2017-09-10/LGPL Development Only (built 2017-09-10)):
After upgrading to 12p (SmartClient Version: v12.0p_2018-03-27/LGPL Development Only (built 2018-03-27)) the same sample seems to ignore editorProperties {canEdit: false}
Is it a regression? Can we have it corrected?
Thanks,
MichalG
UnitDir.xml
We have been using LinkItem as cell editor in ListGrid. The goal is to allow user pick a file through icon while text entry is blocked. This sample illustrates scenario and has been working fine in our production version based on 11.1p (SmartClient Version: v11.1p_2017-09-10/LGPL Development Only (built 2017-09-10)):
Code:
package pl.com.tech4.client; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.data.DataSourceField; import com.smartgwt.client.data.RestDataSource; import com.smartgwt.client.data.fields.DataSourceDateField; import com.smartgwt.client.data.fields.DataSourceFloatField; import com.smartgwt.client.data.fields.DataSourceLinkField; import com.smartgwt.client.data.fields.DataSourceTextField; import com.smartgwt.client.types.FieldType; import com.smartgwt.client.types.ListGridEditEvent; import com.smartgwt.client.widgets.form.fields.FormItem; import com.smartgwt.client.widgets.form.fields.FormItemIcon; import com.smartgwt.client.widgets.grid.CellFormatter; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; public class MainEntryPoint implements EntryPoint { public void onModuleLoad() { layout(); } private void layout() { final RestDataSource ds = new RestDataSource(); ds.setDataURL("UnitDir.xml"); DataSourceField fieldId = new DataSourceField(); fieldId.setName("id"); fieldId.setPrimaryKey(true); fieldId.setHidden(true); DataSourceTextField fieldCode = new DataSourceTextField(); fieldCode.setName("code"); DataSourceLinkField fieldDescription = new DataSourceLinkField("description"); ds.setFields(fieldId, fieldCode, fieldDescription); final ListGrid lg = new ListGrid(); lg.setDataSource(ds); lg.setAutoFetchData(true); lg.setWidth(300); lg.setCanEdit(true); lg.setEditEvent(ListGridEditEvent.DOUBLECLICK); ListGridField codeLGF = new ListGridField("code"); ListGridField descriptionLGF = new ListGridField("description"); FormItem item = new FormItem(); FormItemIcon uploadIcon = new FormItemIcon(); item.setIcons(uploadIcon); item.setHeight(30); item.setCanEdit(false);//<---!? descriptionLGF.setEditorProperties(item); lg.setFields(codeLGF, descriptionLGF); lg.draw(); } }
After upgrading to 12p (SmartClient Version: v12.0p_2018-03-27/LGPL Development Only (built 2018-03-27)) the same sample seems to ignore editorProperties {canEdit: false}
Is it a regression? Can we have it corrected?
Thanks,
MichalG
UnitDir.xml
Code:
<response> <requestId>UnitDir_request5</requestId> <startRow>0</startRow> <endRow>76</endRow> <totalRows>77</totalRows> <data> <UnitDir> <id>341</id> <code>kg</code> <description>kilogram</description> <validFrom>2015-05-26</validFrom> <validTo>2015-05-28</validTo> <quantity>10.5</quantity> </UnitDir> <UnitDir> <id>342</id> <code>szt</code> <description>sztuki</description> <validFrom>2015-05-26</validFrom> <quantity>11.75</quantity> </UnitDir> <UnitDir> <id>343</id> <code>sztuki</code> <description>sztuki</description> <validFrom>2015-05-26</validFrom> <quantity>10000</quantity> </UnitDir> </data> <requestedDataSource>UnitDir</requestedDataSource> <status>STATUS_SUCCESS</status> </response>
Comment