Commit 0e207fbf authored by Benoît Minisini's avatar Benoît Minisini
Browse files

WebTable: ShowRowNumber is a new property that displays the row number in the...

WebTable: ShowRowNumber is a new property that displays the row number in the first column of each row.

[GB.WEB.GUI]
* NEW: WebTable: ShowRowNumber is a new property that displays the row number in the first column of each row.
parent 2c2b7d56
Pipeline #361958141 passed with stage
in 27 minutes and 5 seconds
......@@ -3,7 +3,7 @@
Export
Inherits WebControl
Public Const _Properties As String = "*,Border=True,Mode{Select.*}=None,ShowCheck=True,ShowHeader=True,Sortable"
Public Const _Properties As String = "*,Border=True,Mode{Select.*}=None,ShowCheck=True,ShowHeader=True,ShowRowNumber,Sortable"
Public Const _Group As String = "View"
Public Const _DrawWith As String = "GridView"
Public Const _DefaultSize As String = "24,24"
......@@ -26,6 +26,7 @@ Property ScrollX As Integer
Property ScrollY As Integer
Property ShowCheck As Boolean
Property ShowHeader As Boolean
Property ShowRowNumber As Boolean
Property Sortable As Boolean
Property SortColumn As Integer
Property SortOrder As Integer
......@@ -48,6 +49,7 @@ Private $iEnsureVisible As Integer = -1
Private $bSortable As Boolean
Private $iSortColumn As Integer = -1
Private $bSortDescent As Boolean
Private $bShowRowNumber As Boolean
Public Sub _new()
......@@ -71,6 +73,10 @@ Private Sub PrintRow(iRow As Integer)
Dim sStyle As String
Dim NX As Integer
If $bShowRowNumber Then
Print "<td class=\"gw-table-index\">"; iRow + 1; "</td>";
Endif
If $iMode And If Not $bNoCheck Then
'Print "<td onmousedown=\"gw.table.check("; JS(Me.Name); ","; CStr(iRow);
'If $iMode <> Select.Single Then Print ",event";
......@@ -607,3 +613,17 @@ Private Sub SortOrder_Write(Value As Integer)
Me.Refresh
End
Private Function ShowRowNumber_Read() As Boolean
Return $bShowRowNumber
End
Private Sub ShowRowNumber_Write(Value As Boolean)
If $bShowRowNumber = Value Then Return
$bShowRowNumber = Value
Me.Refresh
End
......@@ -56,6 +56,8 @@ Public Sub _Render()
Print "<thead><tr>";
If hTable.ShowRowNumber Then Print "<th></th>";
iMode = hTable.Mode
If iMode And If hTable.ShowCheck Then
If iMode = Select.Multiple Then
......
......@@ -25,8 +25,6 @@ End
Public Sub WebForm_Open()
WebImage1.Image = "https://radio.erfm.fr/static/erfm.png"
ReloadTable
WebTimer1_Timer
......
......@@ -149,6 +149,7 @@
#MoveScaled(1,15,133.75,40)
Expand = True
Mode = Select.Multiple
ShowRowNumber = True
Sortable = True
}
Index = 1
......@@ -172,7 +173,6 @@
#MoveScaled(1,14,133.75,31)
Height = "14em"
List = [("Élément 1"), ("Élément 2"), ("Élément 3"), ("Élément 4"), ("<i>Élément 5</i>"), ("Élément 6"), ("Élément 7"), ("Élément 8"), ("<span style=\"color:red;\">Élément 9</span>"), ("Élément 10"), ("Élément 11"), ("Élément 12")]
Mode = Select.Multiple
UseHTML = True
}
{ WebTextArea1 WebTextArea
......@@ -207,6 +207,7 @@
}
{ WebImage1 WebImage
#MoveScaled(1,8,133.75,6)
Image = "message/question.png"
}
{ lblTime WebLabel
#MoveScaled(1,15,133.75,4)
......
......@@ -693,6 +693,13 @@ P:first-child,UL:first-child,OL:first-child {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAFUlEQVQYlWNkYGDgYcADmPBJDh8FABV4ABwe4TuyAAAAAElFTkSuQmCC');
}
.gw-table-index {
text-align: right;
border-right: solid 1px #F0F0F0;
font-size: smaller;
font-weight: bold;
}
/*.gw-table > DIV > TABLE > TBODY > TR > TD:last-child {
border-right: none;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment