Skip to content

Commit

Permalink
InputGrid now makes proper <label>s.
Browse files Browse the repository at this point in the history
Grid documentation block moved up so it can be found by WidgetDoc.
  • Loading branch information
abrudz committed Sep 19, 2016
1 parent 0c8c945 commit e77373d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion HTML/_DC/Grid.dyalog
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
:Class Grid : #._DC.Table
∇:require =/Table.dyalog
Description:: Grid - like _.Table but with borders - accepts matrix of data
Constructor:: [Data [CellAttr [HeaderRows [HeaderAttr [MakeCellIds [MakeRowIds]]]]]
Expand All @@ -11,6 +10,8 @@
MakeCellIds - 1 to generate IDs <td id="tableId_r2c3">
MakeRowIds - 1 to generate Row IDs <tr id="tableId_row2">

∇:require =/Table.dyalog

Make0
:Access public
:Implements constructor
Expand Down
7 changes: 5 additions & 2 deletions HTML/_DC/InputGrid.dyalog
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@
:EndIf

htmlRender;cells;rows
htmlRender;cells;rows;ids
SetId
:Access public
idsInputs.id
((ids¨⎕NULL)/ids){GenId}¨+/ids¨⎕NULL
Labelsids{'<label for="',,'">',(renderIt ),'</label>'}¨Labels
cells{⎕NEW #._html.td()}¨renderIt¨(,Labels),[1.1],Inputs
cells[;1].classid,'_label'
cells[;2].classid,'_input'
Expand All @@ -61,4 +64,4 @@
Set('border'(Border))
html⎕BASE.Render
:endclass
:endclass

0 comments on commit e77373d

Please sign in to comment.