Hi Isomorphic,
please take a look at this one (v12.0p_2019-10-06/PowerEdition Deployment (built 2019-10-06)).
When I try to export listGrid data using method "exportData()", translation of column-title is not always applied.
It applies when, for example, I use HeaderSpan for a specific column. Otherwise I get a "technical" name. But that doesn't make sense in my opinion so I think this is a bug.
BuiltInDS.java
animals.ds.xml
Result:
The translation only applies to the 2nd and 3rd column because of
So far we have used "exportClientData()" but we can no longer use it because some ListGrids could contain over 10k data with many columns - export lasts forever. So it is very important for me to export data very quickly and with translation of all column-titles.
Best regards
Pavo
please take a look at this one (v12.0p_2019-10-06/PowerEdition Deployment (built 2019-10-06)).
When I try to export listGrid data using method "exportData()", translation of column-title is not always applied.
It applies when, for example, I use HeaderSpan for a specific column. Otherwise I get a "technical" name. But that doesn't make sense in my opinion so I think this is a bug.
BuiltInDS.java
Code:
package com.smartgwt.sample.client; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.Version; import com.smartgwt.client.core.KeyIdentifier; import com.smartgwt.client.util.Page; import com.smartgwt.client.util.PageKeyHandler; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Button; import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.grid.HeaderSpan; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.layout.VLayout; public class BuiltInDS extends VLayout implements EntryPoint { private IButton recreateBtn; public void onModuleLoad() { KeyIdentifier debugKey = new KeyIdentifier(); debugKey.setCtrlKey(true); debugKey.setKeyName("D"); Page.registerKey(debugKey, new PageKeyHandler() { public void execute(String keyName) { SC.showConsole(); } }); setWidth100(); setHeight100(); recreateBtn = new IButton("Recreate"); recreateBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { new MyWindow().show(); } }); addMember(recreateBtn); new MyWindow().show(); draw(); } private class MyWindow extends Window { public MyWindow() { setWidth(400); setHeight(300); setMembersMargin(0); setModalMaskOpacity(70); setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")"); setShowMinimizeButton(false); setIsModal(true); setShowModalMask(true); centerInPage(); final ListGrid exportGrid = new ListGrid(); exportGrid.setDataSource("animals"); ListGridField commonNameLGF = new ListGridField("commonName"); ListGridField scientificNameLGF = new ListGridField("scientificName"); ListGridField lifeSpanLGF = new ListGridField("lifeSpan"); ListGridField statusLGF = new ListGridField("status"); HeaderSpan headerSpan = new HeaderSpan("HeaderSpan", new String[] { "scientificName", "status" }); exportGrid.setHeaderSpans(headerSpan); exportGrid.setFields(commonNameLGF, scientificNameLGF, lifeSpanLGF, statusLGF); exportGrid.fetchData(); Button exportButton = new Button("Export_data"); exportButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { exportGrid.exportData(); } }); addMember(exportGrid); addMember(exportButton); } } }
Code:
<DataSource ID="animals" serverType="sql" tableName="animals" testFileName="animals.data.xml" > <fields> <field name="commonName" title="Animal-TRANSLATION" type="text"/> <field name="scientificName" title="Scientific Name-TRANSLATION" type="text" primaryKey="true" required="true"/> <field name="lifeSpan" title="Life Span-TRANSLATION" type="integer"/> <field name="status" title="Endangered Status-TRANSLATION" type="text"> <valueMap> <value>Threatened</value> <value>Endangered</value> <value>Not Endangered</value> <value>Not currently listed</value> <value>May become threatened</value> <value>Protected</value> </valueMap> </field> <field name="diet" title="Diet" type="text"/> <field name="information" title="Interesting Facts" type="text" length="1000"/> <field name="picture" title="Picture" type="image" detail="true" imageURLPrefix="/isomorphic/system/reference/inlineExamples/tiles/images/"/> </fields> </DataSource>
The translation only applies to the 2nd and 3rd column because of
Code:
HeaderSpan headerSpan = new HeaderSpan("HeaderSpan", new String[] { "scientificName", "status" });
So far we have used "exportClientData()" but we can no longer use it because some ListGrids could contain over 10k data with many columns - export lasts forever. So it is very important for me to export data very quickly and with translation of all column-titles.
Best regards
Pavo
Comment