From 7da00b0c6c06040b2092f6b76ad5626a75dc71cd Mon Sep 17 00:00:00 2001 From: Hyyan Abo Fakher Date: Tue, 23 Jul 2019 15:41:16 +0200 Subject: [PATCH] fix: setSelectedRows/setSelectedRows must not deselect all rows by default 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 --- BBjGridExWidget.bbj | 2 -- demo/SelectionDemo.bbj | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BBjGridExWidget.bbj b/BBjGridExWidget.bbj index bdcb76c3..94037889 100644 --- a/BBjGridExWidget.bbj +++ b/BBjGridExWidget.bbj @@ -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 @@ -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 diff --git a/demo/SelectionDemo.bbj b/demo/SelectionDemo.bbj index e3a66827..b00751f4 100644 --- a/demo/SelectionDemo.bbj +++ b/demo/SelectionDemo.bbj @@ -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 @@ -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