Hi,
Please review the sample code provided.
I have encountered issues while attempting to edit existing highlights in the ListGrid. Specifically, there seems to be a bug in the filter functionality within the Advanced Highlight Editor.
Test case:
1. Click the Edit Highlights button.
2. Select the Name field from the Available Fields list.
3. Set the Text and Background colors for the Name field where the value is "Jatin" and save.
4. Click the Edit Highlights button again.
5. In the opened window, Edit Existing Highlights.
6. The Advanced Highlight Editor window will open.
7. In the Filter group, you will notice that only the Name field appears in the dropdown, and no other ListGrid fields are available.
I am unable to select the Date or Age fields and set highlights on the Name field.
The issue arises because, when I set setCanFilter(true) on the Name field, only this field appears in the dropdown. For all other fields, I’ve set setCanFilter(false), so they don't appear.
I want to set setCanFilter(true) only for the Name field, and keep it false for all other fields.
Additionally, I encountered another bug: when editing highlights in the Filter group, the "Contains" option is always selected, even when you choose "One of" for the highlights.
I have attached all relevant screenshots with this post.
I’m using SmartGWT 13.1 LGPL Edition on the latest version of Chrome.
Thank you!
Please review the sample code provided.
Code:
import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.Record; import com.smartgwt.client.data.fields.DataSourceDateField; import com.smartgwt.client.data.fields.DataSourceTextField; import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; import com.smartgwt.client.widgets.layout.VLayout; public class ListgridHiliteExample implements EntryPoint { @Override public void onModuleLoad() { VLayout layout = new VLayout(0); layout.setWidth100(); layout.setHeight100(); // Define the DataSource DataSource dataSource = new DataSource(); dataSource.setClientOnly(true); // Client-side only DataSource DataSourceTextField idField = new DataSourceTextField("id", "ID"); DataSourceTextField nameField = new DataSourceTextField("name", "Name"); DataSourceDateField independenceField = new DataSourceDateField("date", "Date"); DataSourceTextField ageField = new DataSourceTextField("age", "Age"); dataSource.setTestData(new Record[] { getData("1", "John Doe", "2024-05-10", "25"), getData("2", "Jane Smith", "2024-05-10", "30"), getData("3", "Jatin Garala", "2024-05-10", "40") }); dataSource.setFields(idField, nameField, independenceField, ageField); // Define the ListGrid ListGrid listGrid = new ListGrid(); listGrid.setWidth(500); listGrid.setHeight(300); listGrid.setShowFilterEditor(true); listGrid.setDataSource(dataSource); listGrid.setAutoFetchData(true); ListGridField idListField = new ListGridField("id", "ID"); idListField.setCanFilter(false); ListGridField nameListField = new ListGridField("name", "Name"); nameListField.setCanFilter(true); ListGridField dateListField = new ListGridField("date", "Date"); dateListField.setCanFilter(false); ListGridField ageListField = new ListGridField("age", "Age"); ageListField.setCanFilter(false); IButton editHilitesButton = new IButton("Edit Hilites"); editHilitesButton.setAutoFit(true); editHilitesButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { final String hiliteStr = listGrid.getHiliteState(); if(hiliteStr!=null && !hiliteStr.isEmpty()) { listGrid.setHiliteState(hiliteStr); listGrid.editHilites(); } else { listGrid.editHilites(); } } }); listGrid.setFields(idListField, nameListField, dateListField, ageListField); layout.addMember(editHilitesButton); layout.addMember(listGrid); layout.draw(); } public Record getData(String id, String name, String date, String age) { Record record = new ListGridRecord(); record.setAttribute("id", id); record.setAttribute("name", name); record.setAttribute("date", date); record.setAttribute("age", age); return record; } }
I have encountered issues while attempting to edit existing highlights in the ListGrid. Specifically, there seems to be a bug in the filter functionality within the Advanced Highlight Editor.
Test case:
1. Click the Edit Highlights button.
2. Select the Name field from the Available Fields list.
3. Set the Text and Background colors for the Name field where the value is "Jatin" and save.
4. Click the Edit Highlights button again.
5. In the opened window, Edit Existing Highlights.
6. The Advanced Highlight Editor window will open.
7. In the Filter group, you will notice that only the Name field appears in the dropdown, and no other ListGrid fields are available.
I am unable to select the Date or Age fields and set highlights on the Name field.
The issue arises because, when I set setCanFilter(true) on the Name field, only this field appears in the dropdown. For all other fields, I’ve set setCanFilter(false), so they don't appear.
I want to set setCanFilter(true) only for the Name field, and keep it false for all other fields.
Additionally, I encountered another bug: when editing highlights in the Filter group, the "Contains" option is always selected, even when you choose "One of" for the highlights.
I have attached all relevant screenshots with this post.
I’m using SmartGWT 13.1 LGPL Edition on the latest version of Chrome.
Thank you!
Comment