[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Connect 2 grids on a blank form

  • Thread starter Thread starter Ricardo Perdigao
  • Start date Start date
Status
Not open for further replies.
R

Ricardo Perdigao

Guest
Hi Richard, On the orders grid in the KUIB View: - Make sure that your "Selection type:" is Single - Make sure you select the "Model" - Assign a function called "onOrdersChange" to the "Row Select Event Function" - Assign a function called "onOrdersData" to the "Data Bound Event Function" Edit the controller.public.js for View: - Updated the code below with the correct names for your objects and add it to the contoller.public.js below the closing of the function "onShow" as shown on the example below (you don't need to duplicate Onshow): onShow($scope) { console.log('Show'); } onOrdersData($scope) { this.$components.ordersGrid.widget.select('tr[data-uid]:eq(0)'); } onOrdersChange($scope) { console.log('onCustomerChange'); var dataGrid = this.$components.ordersGrid.widget; var selectedLine = dataGrid.select(); var lineData = dataGrid.dataItem(selectedLine); var value = lineData.OrderNum; if (value) { var filter = { logic:'and', filters: [ { field: 'OrderNum', operator: 'eq', value: value } ] }; this.$ds['orderDS'].filter(filter); } else { this.$ds['orderDS'].filter({}); } } Please don't forget to: - Call your orders Grid "ordersGrid" or replace that with the correct name for you "orders" Grid - Call your orders Data Source "orderDS" or replace that with the correct name for you "orders" Data Source - Replace "OrderNum" with the key field that links Orders and OrderLines of Orders - If you have more than one field linking the two tables, you will need to expand the filter to include both fields. Please give a try and let me us know how far do you get! All the best, Ricardo Perdigao

Continue reading...
 
Status
Not open for further replies.
Back
Top