Get KoolPHP UI with 30% OFF!

Create a list that uses a data column from a higher level grid as part of the selection criteria

Scott
So we have a grid hierarchy of Orders and then order item.
Now if I want to add an item to an order that is simple enough with using a dropdowncolumn.
select * from products ( for example).
Now here is were it gets a bit harder. Each customer has its own discrete list of items it may order.
How do I create a query that select items and uses the customer id in the order as part of the selection ?
select * from products where customer.id=X
Posted Dec 29, 2015 Kool
ADavid Wulkan
I don't see anyone else responding. So here's what I suspect; This is the code example for the three level grid. Does this sound like what you are asking?
This is how the orders table is linked to the customers table.
$table_order->AddRelationField("customerNumber","customerNumber"); <-- this gets added to the SQL query (select and where clauses)
$table_order->AutoGenerateExpandColumn = true;
$table_order->AutoGenerateColumns = true;
$table_order->DisableAutoGenerateDataFields = "customerNumber"; <-- this tells the lower level grid to leave out this column on the grid even though it is in the result set
$table_order->AddDetailTable($table_order_detail);
Posted Dec 31, 2015 , edited Dec 31, 2015 Kool -
Scott
Not exactly. The code you listed I believe shows how to link parent child grids.
What I am getting at is in the child grid I want to add or edit a row in that in that row is droplist column.
Said droplist is generated by a sql command and then a foreach loop to add in the result set as items for the drop list.
The trick I am looking for is when coding in the sql how to I include the customer id from the parent grid.
Posted Jan 2, 2016 Kool
Anthony Amolochitis
It sounds like an edit template can be used instead. That way when you attempt to add/edit information for a specific customer/user/etc..., you may customize your form and post back any data you need as long as it can be posted. I use edit templates all of the time to do all kinds of nice saves. I hope this helps.
Posted Jan 3, 2016 Kool
Peter
Anthony is right. The best solution is to use GridTemplate.
Posted Jan 5, 2016 Kool