Skip to content

Commit

Permalink
fix(md-3843): fix expand row android (#138)
Browse files Browse the repository at this point in the history
* fix: alpha android

* fix: expand row
  • Loading branch information
gruskal authored and enell committed Feb 9, 2023
1 parent 4b9543a commit a28060c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void handleDragBoxDrag(Rect dragBoxBounds, int columnId) {
}

private void expandRow() {
EventUtils.sendOnExpand(tableView, column, row);
EventUtils.sendOnExpand(tableView, row);
}

private void copyCell(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,19 @@ public static void sendOnHeaderTapped(View contextView, DataColumn column) {
}
}

public static void sendOnExpand(View contextView, DataColumn column, DataRow row) {
public static void sendOnExpand(TableView tableView, DataRow row) {
WritableMap event = Arguments.createMap();
List<DataColumn> columns = tableView.dataProvider.getDataColumns();
try {
JSONObject columnJSONObject = column.toEvent();
JSONArray columnJSONArray = new JSONArray();
columnJSONArray.put(columnJSONObject);

for (DataColumn column : columns) {
JSONObject columnJSONObject = column.toEvent();
columnJSONArray.put(columnJSONObject);
}
String rowJSONString = row.toEvent();
event.putString("row", rowJSONString);
event.putString("col", columnJSONArray.toString());
EventUtils.sendEventToJSFromView(contextView, "onExpandCell", event);
EventUtils.sendEventToJSFromView(tableView, "onExpandCell", event);
} catch (JSONException e) {
e.printStackTrace();
}
Expand Down

0 comments on commit a28060c

Please sign in to comment.