Sandwich menu



Introduction



The sandwich menu recipe provides an example how to setup a sandwich ordering application (who doesn't need such application) using the grid.

The grid is initialized with a sandwich menu from your local caterer. Day by day, users can enter the number of sandwiches requested.



Screenshots

Grid configuration

gd.columns=sandwich,price,unit gd.table=sandwich_order gd.ds = jira gd.query=select name,price from sandwich_menu gd.query.ds=gridds gd.filter=true col.sandwich=Sandwich col.sandwich.type=string col.sandwich.editable=false col.sandwich.width=200 col.price=Price col.price.type=number col.price.editable=false col.price.width=75 col.unit=Count col.unit.type=number col.unit.minvalue=0 col.unit.maxvalue=10 col.unit.width=75

SQL Setup

Use following sql to create a table and populate the sandwich menu table.

- -- Table structure for table `sandwich_menu` -- DROP TABLE IF EXISTS `sandwich_menu`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `sandwich_menu` ( `id` int(11) NOT NULL AUTO_INCREMENT, `Name` varchar(45) DEFAULT NULL, `Price` double DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `sandwich_menu` -- LOCK TABLES `sandwich_menu` WRITE; /*!40000 ALTER TABLE `sandwich_menu` DISABLE KEYS */; INSERT INTO `sandwich_menu` VALUES (1,'Lemon pepper chicken',1.95),(2,'Chicken tikka with minted mayo',1.95),(3,'Chicken and bacon',1.95),(4,'Cajun chicken',1.95),(5,'Chinese chicken',1.95),(6,'BBQ chicken',1.95),(7,'Mexican chicken',1.95),(8,'Tuna mayo',1.65),(9,'Tuna crunch',1.85),(10,'Egg mayo',1.5),(11,'Egg mayo & crispy bacon',1.95),(12,'Prawn & marie rose sauce',2.2),(13,'Cheese',1.3),(14,'Cheese mix',1.6),(15,'Ham',1.8),(16,'Beef',1.8),(17,'Corned beef',1.8),(18,'Turkey',1.8); /*!40000 ALTER TABLE `sandwich_menu` ENABLE KEYS */; UNLOCK TABLES;

See also

Sandwich Order