From 50912118608eb56c9b3c2e7188753801a82bdae3 Mon Sep 17 00:00:00 2001 From: Stephan Wald Date: Wed, 7 Mar 2018 13:14:36 +0100 Subject: [PATCH] introduced asDataRow to return row info in datarow format --- BBjGridExWidget.bbj | 6 ++++++ Demo/TwoGridsDemo.bbj | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/BBjGridExWidget.bbj b/BBjGridExWidget.bbj index f22c4054..abbdb725 100644 --- a/BBjGridExWidget.bbj +++ b/BBjGridExWidget.bbj @@ -24,6 +24,12 @@ class public BBjGridExWidgetRow method public String toString() methodret #Id! methodend + + method public DataRow asDataRow() + + methodret DataRow.fromJson(#Data!.toString()) + + methodend classend class public BBjGridExWidgetSelectRowEvent diff --git a/Demo/TwoGridsDemo.bbj b/Demo/TwoGridsDemo.bbj index b3a6e4db..cf0fdf9f 100644 --- a/Demo/TwoGridsDemo.bbj +++ b/Demo/TwoGridsDemo.bbj @@ -49,15 +49,11 @@ resize: return showDetails: - ev! = BBjAPI().getLastEvent() - data$= ev!.getObject().getRows().getItem(0).getData().toString() - rec! = DataRow.fromJson(data$) + rec! = grid!.getSelectedRowInfo().asDataRow() cust$=rec!.getFieldAsString("CUST_NUM") dsbc! = new SqlQueryBC(BBjAPI().getJDBCConnection("ChileCompany")) drs! = dsbc!.retrieve("SELECT * FROM ORDER_HEADER WHERE CUST_NUM='"+cust$+"'") dtlgrid!.setData(drs!) - - return \ No newline at end of file