Hi Isomorphic,
I have following code:
.ds.xml fields:
ListGrid:
ListGridFieldCampaign:
Depending on setDisplayField("CAMPAIGN_NAME") in ListGridFieldCampaign the fetch() sorts by either T_CAMPAIGN.ID or T_CAMPAIGN.NAME.
I think it should always sort by T_CAMPAIGN.NAME (because of the displayField="CAMPAIGN_NAME" in .ds.xml). Is that true?
Best regards,
Blama
I have following code:
.ds.xml fields:
Code:
<field foreignKey="T_CAMPAIGN.ID" name="CAMPAIGN_ID" [B]displayField="CAMPAIGN_NAME"[/B] type="integer"></field> <field name="CAMPAIGN_NAME" includeFrom="T_CAMPAIGN.NAME" hidden="true"></field>
Code:
... ListGridField campaignLGF = new [B]ListGridFieldCampaign[/B]("CAMPAIGN_ID"); setSort(new SortSpecifier[] { new SortSpecifier("CAMPAIGN_ID", SortDirection.ASCENDING) }); setFields(campaignLGF, ...); fetchData();
Code:
public final class ListGridFieldCampaign extends ListGridField { public ListGridFieldCampaign(final String name) { super(name); [B]TRY WITH OR WITHOUT: setDisplayField("CAMPAIGN_NAME");[/B] setSortByDisplayField(true); } }
I think it should always sort by T_CAMPAIGN.NAME (because of the displayField="CAMPAIGN_NAME" in .ds.xml). Is that true?
Best regards,
Blama