Skip to content

Commit

Permalink
fix: setSelectedRows/setSelectedRows must not deselect all rows by de…
Browse files Browse the repository at this point in the history
…fault

BREAKING CHANGE: setSelectedRows/setSelectedRows methods used to
deselect all rows before appling the new selection, this is not the case
anymore , if you still need the old behavior then call `grid!.deselectAlldeselectAll()` before
applying the new selection
  • Loading branch information
hyyan committed Jul 23, 2019
1 parent 04ec9fb commit 7da00b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions BBjGridExWidget.bbj
Expand Up @@ -1882,7 +1882,6 @@ class public BBjGridExWidget extends BBjWidget implements BBjGridExWidgetColumns
rem * @param BBJNumber x!: the row index to select
rem */
method public void setSelectedRow(BBjNumber x!)
#deselectAll()
script$="gw_setSelectedRows('" + #GRIDID$ + "',[" + str(x!) + "]);"
#executeScript(script$)
methodend
Expand All @@ -1894,7 +1893,6 @@ class public BBjGridExWidget extends BBjWidget implements BBjGridExWidgetColumns
rem * @param BBJNumber x!: vector of row indices to select
rem */
method public void setSelectedRows(BBjVector x!)
#deselectAll()
script$="gw_setSelectedRows('" + #GRIDID$ + "',["
it! = x!.iterator()
first=1
Expand Down
2 changes: 2 additions & 0 deletions demo/SelectionDemo.bbj
Expand Up @@ -180,6 +180,7 @@ return
onSelectionInputButton:
selection! = selectionInput!.getText()
sel = num(selection!,err=onMultiSelectionInput)
grid!.deselectAll()
grid!.setSelectedRow(sel)

rem now make sure this row is visible, in the middle
Expand All @@ -199,6 +200,7 @@ onMultiSelectionInput:
s!.addItem(num(x!.get(i),err=*continue))
next i

grid!.deselectAll()
grid!.setSelectedRows(s!)

if (s!.size() > 0) then
Expand Down

0 comments on commit 7da00b0

Please sign in to comment.