Fix DataSource.Find() on MySQL. DataView now correctly unselect all lines when we are in creation mode and the view is not editable.
[GB.DB.FORM] * BUG: DataTable: Write the SQL request of the Find() method is a way that is compatible with MySQL. * BUG: DataView: Correctly unselect all lines when we are in creation mode and the view is not editable.
This commit is contained in:
parent
ac15f27a96
commit
a840f497b8
@ -171,7 +171,7 @@ Public Sub Find(sWhere As String, Optional iFrom As Integer) As Integer
|
||||
Dim rFind As Result
|
||||
|
||||
sSelect = "ROW_NUMBER() OVER (" & $DB.SQL.OrderBy(GetSortKeys())() & ") AS __index"
|
||||
sReq = $DB.SQL.Select([sSelect, "*"]).From($sTable).Where($sFilter)()
|
||||
sReq = $DB.SQL.Select(["*", sSelect]).From($sTable).Where($sFilter)()
|
||||
|
||||
sReq = "SELECT * FROM (" & sReq & ") AS __pg_sucks WHERE " & sWhere
|
||||
If iFrom > 0 Then sReq &= " AND __index >= " & CStr(iFrom + 1)
|
||||
@ -180,7 +180,7 @@ Public Sub Find(sWhere As String, Optional iFrom As Integer) As Integer
|
||||
If rFind.Count = 0 Then
|
||||
Return -1
|
||||
Else
|
||||
Return rFind[0] - 1
|
||||
Return rFind["__index"] - 1
|
||||
Endif
|
||||
|
||||
End
|
||||
|
@ -89,6 +89,7 @@ Public Sub _new()
|
||||
$bAllColumns = True
|
||||
Update
|
||||
Create()
|
||||
UpdateMode
|
||||
|
||||
$bHighlight = True
|
||||
UpdateHighlightColor
|
||||
@ -941,7 +942,7 @@ Private Sub UpdateMode()
|
||||
|
||||
Object.Lock($hCtrl)
|
||||
|
||||
If $bCreate And If HasNewRecord() Then
|
||||
If $bCreate And If Not HasNewRecord() Then
|
||||
$hCtrl.Mode = Select.None
|
||||
Else
|
||||
$hCtrl.Mode = $iMode
|
||||
|
Loading…
x
Reference in New Issue
Block a user