I would like to know if a grid can be used as an input component like I can use a form as an input component. For example, I want to be able to enter a customer order by having a form at the top to enter all of the customer information (customer name, address, date of order, etc) and a grid on the bottom to enter the products that the customer orders (i.e. the customer may order multiple products in one order). The grid would contain data such as item number, qty, color, price, etc. From the user’s perspective these would look like one integrated input screen. The documentation does a good job of showing how to populate a grid with data, change individual records, delete records, etc; however, it does not show how to have a “blank” grid, where a user can enter information in each cell and then click a button to save each record to a database. If the dhtmlxGrid has this functionality, how do I begin to set up and use the grid in this way?
amwh, I just read you post and thought I might lend a hand… Sure you can use grid as an input, and you can attach it side of form.
1st create a form and get the top portion working. The top part will be a standard form with the standard form element. Take a look at the docs and examples to build this portion:
docs.dhtmlx.com/doku.php?id=dhtmlxform:toc
dhtmlx.com/docs/products/dhtmlxForm/samples/
Once the top section of the form is working, add the grid into the form as a container:
docs.dhtmlx.com/doku.php?id=dhtm … _container
You’ll setup the grid structure with drop down lists, checkboxes, editable fields, etc… The grid structure is different from the grid data. So when the form loads, initialize the grid structure and do not load any rows.
The user can click on the row and edit it as needed. You may want to change the key map to Access as this opens in edit mode when tabbing:
dhtmlx.com/docs/products/dht … ccess.html
So once you have the top section and the grid in your form, the only thing left to do is save the data. I would use a custom save function which gets the data out of the form and out of the grid and then ajax the data to the server.
All in all, this is very doable. Start with the top section of the form and then add the grid container and then customize the save function.
Hope this helps…I’ve been working with dhtmlx for around 2 years and use forms with containers a lot. They look great and work great.
Thanks for the feedback bmcgin, I’ll try that.
amwh