Simple Example Of Creating A View Using HTMLElement


#1

There are a few examples in https://github.com/atom/atom/tree/master/src of HTMLElement based views, but most are encumbered by having to support the legacy of the prior SpacePen views.

Does anyone have an example of a minimal HTMLElement based view - perhaps one which displays a list of items? I would like to replace the autocomplete SelectListView / autocomplete-plus SimpleSelectListView with an HTMLElement based View, and am beginning my learning of HTMLElement.

/cc @abe @nathansobo


#2

I recently updated my status bar indicator packages to use the HTMLElement style. One example is my IndentationIndicatorView:

https://github.com/lee-dohm/indentation-indicator/blob/master/lib/indentation-indicator-view.coffee

The pattern was copied shamelessly from @maxbrunsfeld’s work on the GrammarStatusView:

https://github.com/atom/grammar-selector/blob/master/lib/grammar-status-view.coffee


#3

Another example of an even simpler view is in the new Package Generator. If you generate a new package, the demo view in there has been updated for the new system.


#4

I think it should be pretty straightforward, once you have your element class (like in @leedohm examples) you can handle the item rendering in whatever way you prefer, whether through innerHTML (bad) or through appendChild.

Is there anything in a list management that confuse you?