Is it possible to save data back? Carlos?
or Austin at:
At these samples we can update a column.
So, Is it possible to save data back into db?
How can we save changed data to the database or any csv file?
could be done with ADO/ODBC-connection (or open/close a DB with CGI commands).
Then, (after update the DB, with any of above), the server generates a new "csv/xlm" file that reload the grid data - "Get".
I know, it sounds easy for (local test or single user), but in a multi-user environment (and keeping in mind that we are off-line) it is a "must" to control a lot of updating situations.
- try to modify a record that not longer exist into D.B. (deleted e few seconds ago - but you can see it )
- updating a (just updated record)
- append (unique key) duplicates ........ etc
(so maybe need to generate a possible errors "at server" and "lock" the grid with some "last changes unsuccesfull- please reload" --message
Normally we have forms and We can post data with submitting forms. For example If we have a form element named "tel" (..input type=text name=tel ..), we can get it as variable like "$tel" at the server side script(PHP).
How can we do it with these grids. How can we submit grid values to the server side script?
<textarea id="myId" name="myArg"></textarea>
document.getElementById("myId").value = myData.join("\n");
and then submit form to the server.
This simple join("\n") call will insert line break between rows and comma between cells, but in real life you probably need more complex formatting to escape commas inside your cell data etc.
and then in page.php
ActiveWidgets has a class which does all that and is used as a base for CSV and XML retrieval (Active.HTTP.Request). But you can also post data back with this class, not only retrieve.
Here is a nice article which explains it better than I do:
I think for your code to be useful to web developers around the globe, an example of this would be needed. This thread seems like the perfect place.
Of course, nobody wants to re-invent the wheel. I'd love to see some examples of code that can do this so I can run with it for my application!
This topic is archived.
Back to support forum
Version 2Looking for AW 2.6 ?
The old site is here.