简体   繁体   中英

Dojo Data Grid - custom row, not being defined by structure

Is it possible to add a custom row to my datagrid?

For example if I have a country list, I want all the countries with their attributes being displayed in a table. However, I want to add each continent name only once, like:

Continent1
Country 1 ... ... ...
Country 2 ... ... ...

Continent2
Country 3 ... ... ...
Country 4 ... ... ...

Continent3
Country 5 ... ... ...
Country 6 ... ... ...

I know I could define a structure with two rows in the header, but then the name of the continent would appear for every country.

(I don't want to do a country list, but just as an example)

Take a look at dojox.grid.TreeGrid

You can see an example similar to yours here: http://archive.dojotoolkit.org/nightly/dojotoolkit/dojox/grid/tests/test_treegrid.html

(look at the third example labelled "dojox.grid.TreeGrid 2-Level (programmatic)")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM