Scroll untuk baca artikel
Programmingsencha gxt

Grouping field to grid sencha gxt2

381
×

Grouping field to grid sencha gxt2

Sebarkan artikel ini
sencha gxt2
sencha gxt2

For those who have trouble making grouping on the grid. Please create a global variable for the initial declaration: Example:

private GroupingStore storeGrouping

Then in the initial grid section is added :

storeGrouping.groupBy("name_grouping");

At the bottom then added :

	final ColumnModel cm = new ColumnModel(config);  

	GroupingView view = new GroupingView();  
	view.setForceFit(true);  

	view.setGroupRenderer(new GridGroupRenderer() {  
		public String render(GroupColumnData data) {  
			String f = cm.getColumnById(data.field).getHeader();  
			String l = data.models.size() == 1 ? "Item" : "Items";  
			return f + ": " + data.group + " (" + data.models.size() + " " + l + ")";  
		}  
	});  

	EditorGrid<SaveItem> grid = new EditorGrid<SaveItem>(store, cm);  
	grid.setView(view);  
	grid.setBorders(true);

In order for the datagrid to be grouped and sorted by the beginning or alphabetical order numbers at the beginning

 

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Verified by MonsterInsights