PDA

View Full Version : Very simple Writer example?



v2108
14 Aug 2012, 2:28 AM
Hey guys,

I am looking for a very simple example for using a writer, to write data into a server-side file. Maybe, just one textbox, which text is loaded into the file. Does anyone know such a simple example? I just want to understand the function to write the data.

All examples I found, including the Sencha example 'Writer', are very long.I am new to Extjs and this code very complicated.

Please help me, if possible. I really need this code for an important project.

Thanks, Victoria

friend
14 Aug 2012, 4:55 AM
ExtJs Writer classes don't actually 'write files' on the server-side, they just enforce that the submitted data is formatted in a particular manner. Your server-side code is responsible for writing the submitted data to a file on its local filesystem.

v2108
14 Aug 2012, 5:23 AM
I know that a server-side-code is needed to write the data to the file, but I does'nt understand how this all works together and with a large example it's really hard to find out how it works.

scottmartin
14 Aug 2012, 9:22 AM
Here are few small CRUD examples:
http://www.sencha.com/forum/showthread.php?229457

Scott.

v2108
15 Aug 2012, 10:40 PM
Hey,

the 2 examples are greate, but do I need a mysql database to test the examples?

v2108
16 Aug 2012, 12:20 AM
Your examples are great, thank you very much !! :D

I fixed the problem with the database, but I still get this error:

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\example2\save_product.php on line 71
{"success":true,"data":null}

This is the code:

while($rec = mysql_fetch_array($result,MYSQL_ASSOC)){
$arr[] = $rec; };

The data is loaded into the database, but the grid is not automatically actualized.

Can you tell me, what is wrong?

scottmartin
16 Aug 2012, 6:39 AM
but do I need a mysql database to test the examples
These are based on mysql, but you can replace with any DB and change the syntax as needed.

What is the value of $result. It should be a valid result from the above line.
You may have to eval each var to see what is return. The result set $data should be populated.

Scott.