on develop help sign in
Add tableDynAttr & tabDisplay to quickref
commitf98b5b7a6e03e9b49ace62ba02fec2844b87444f authorDan Brown <dbbnrl@gmail.com> dateWed 5 Aug 2015, 11:29 (11 years ago) parent8632861
1 file changed+15−7
Quickref.md+15−7
Quickref.md+15−7
@@ -37,10 +37,10 @@ Widgets may return any type (this is 'a' in many of the functions below). Often
3737[W] elDynAttr' :: String -> Dynamic (Map String String) -> m a -> m (El, a)
3838
3939-- Shortcut for elAttr when you only want to set the "class" attribute.
40−[W] elClass :: String -> String -> m a -> m a
40+[W] elClass :: String -> String -> m a -> m a
4141
4242-- Even shorter-cut for above when element type is "div". Create a div of given class.
43−[W] divClass :: String -> m a -> m a
43+[W] divClass :: String -> m a -> m a
4444
4545-- Create a widget of given type with arbitrary, Dymamic HTML inside.
4646[W] elDynHtml' :: String -> Dynamic String -> m El
@@ -110,11 +110,6 @@ Note the "list" functions do not imply particular HTML tags (ul, li, etc), thoug
110110-- Same as listWithKey, but takes initial values and an updates Event instead of a Dynamic.
111111[W] listWithKey' :: Ord k =>
112112 Map k v -> Event (Map k (Maybe v)) -> (k -> v -> Event v -> m a) -> m (Dynamic (Map k a))
113−
114−-- tableDynAttr
115−-- tabDisplay
116−-- workflow
117−-- workflowView
118113```
119114
120115### Utility widgets
@@ -136,6 +131,19 @@ Some of these widget builders take a configuration record and return a record co
136131[W] dropdown :: (Ord k, Show k, Read k) =>
137132 k -> Dynamic (Map k String) -> DropdownConfig k -> m (Dropdown k)
138133
134+-- Given class, list of columns with (column header, function from row key and Dynamic row
135+-- value to widget), Dynamic map from row key to row value, and function from row key to
136+-- Dynamic row attributes, produce a table widget that returns a Dynamic map from row keys
137+-- to (row El, list of row widget values).
138+[W] tableDynAttr :: (Show k, Ord k) =>
139+ String -> [(String, k -> Dynamic r -> m v)] -> Dynamic (Map k r) ->
140+ (k -> m (Dynamic (Map String String))) -> m (Dynamic (Map k (El, [v])))
141+
142+-- Construct a tabbed view that shows only one of its child widgets at a time. Takes a class
143+-- for the "ul" element, a class for the currently active "li" element, and a map from arbitrary
144+-- keys to (tab label, tab widget) pairs.
145+[W] tabDisplay :: (Show k, Ord k) => String -> String -> Map k (String, m ()) -> m ()
146+
139147-- Widget to efficiently display long scrolling lists. Dynamically control number of items in
140148-- list, current scroll position, attributes, and row content. Returns current scroll position
141149-- and current selection. Full documentation in Reflex/Dom/Widget/Lazy.hs