What I’m trying to do:
I have a Quote Grid which pops up all of the incomplete Quotes which need work. The user clicks on a button in the Quote Data Grid to select the quote to work on. This runs in the Quote Data Grid RowTemplate context. I successfully reach the Main Form (ProcessQuoteTemplate is the name) and I see the data for the Quote Items being fetched from debugging. However, the insertion into the repeating_panel for the Quote Items Data Grid fails.
The routine used to populate the Quote Items Data Grid is in the ProcessQuoteTemplate class. I’ve tested it and it works well, but only in that context.
What I’ve tried and what’s not working:
I’ve tried invoking the function this way as well:
ProcessQuoteComponent.load_quote_items_grid(ProcessQuoteComponent(), self.item[‘QuoteNum’])
The print() in load_quote_items_grid() retrieves the correct information from the DataTable every time. The issue is the Quote Items DataGrid does not get populated through the "repeating_panel_quote_items.items = " method
Code Sample:
def button_select_click(self, **event_args):
# load the specific quote's Quote Items
#print(self.item['QuoteNum'])
ProcessQuoteComponent().load_quote_items_grid(self.item['QuoteNum'])
# then set Quote Item data grid to be visible.
ProcessQuoteComponent().set_list_visible(True)
# here is the load_quote_items_grid() function
def load_quote_items_grid(self, qn):
rows = anvil.server.call('any_items', qn)
if rows:
# select all of the Quote Item data columns into the panel, just skip the first column pointer
preload = [
{
'SKU': row['SKU'],
'ManufNum': row['ManufNum'],
'Qty': row['Qty'],
'TargetPrice': row['TargetPrice'],
'Description': row['Description'],
'StygianCost': row['StygianCost'],
'QuotePrice': row['QuotePrice'],
'TaxRate': row['TaxRate'],
'EstDelivery': row['EstDelivery']
}
for row in rows
]
print(preload)
self.repeating_panel_quote_items.items = preload
Clone link: