Skip to content

Commit

Permalink
fix: setRowData(index! , row!) does not need index
Browse files Browse the repository at this point in the history
fix! #184
  • Loading branch information
hyyan committed Mar 4, 2020
1 parent 5102654 commit 335c3da
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions BBjGridExWidget.bbj
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,8 @@ class public BBjGridExWidget extends BBjWidget implements BBjGridExWidgetColumns
rem *
rem * @param BBjNumber index! The Row index
rem * @param DataRow row! DataRow object which contains the update
rem *
rem * @deprected
rem */
method public void setRowData(BBjNumber index!,DataRow row!)
if #RS!.count() <> 0 then
Expand All @@ -1667,6 +1669,20 @@ class public BBjGridExWidget extends BBjWidget implements BBjGridExWidgetColumns
FI
methodend
rem /**
rem * Update row data
rem *
rem * <br><b><small>#API</small></b>
rem *
rem * @param DataRow row! DataRow object which contains the update
rem */
method public void setRowData(DataRow row!)
if #RS!.count() <> 0 then
#getRS().set(#getRS().indexOf(row!),row!)
parser! = new JsonParser()
#executeScript("gw_setRowData('"+ #GRIDID$ + "'," + parser!.parse(row!.toJson(#getRowNodeId())).getAsJsonArray().get(0).toString() +")")
FI
methodend
rem /**
rem * Add new row
rem *
rem * <br><b><small>#API</small></b>
Expand Down
2 changes: 1 addition & 1 deletion demo/DataUpdateDemo.bbj
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ updateThirdRow:
row!.setFieldValue("TITLE","My Updated Title")
row!.setFieldValue("ARTIST","My Updated Artist")

grid!.setRowData(2 , row!)
grid!.setRowData(row!)
return

rem /**
Expand Down

0 comments on commit 335c3da

Please sign in to comment.