there are two templates i am using for view and edit(is having the form to update), the view will contain edit(link or button), on clicking the edit button i want that the edit template should be loaded (using Ajax, without refreshing the page). and after editing it should be redirected to view again (using ajax same as above). is there any code or method to do that? please help me...
A:
You can replace your whole content DIV with the result of the AJAX call. In the controller, check if the request is a XMLHTTP request. If so, only return the template without the layout around it.
So you don't change the template, you are just fetching the result of an action via AJAX.
Hava a look the documentation integrating AJAX.
Felix Kling
2009-12-15 13:28:24
A:
You should also consider in-place editing if it'll fit into your design.
sjobe
2009-12-15 16:54:50
yeah, i tried that but not working... is there anything, that i should do in Action?? and in div what should i put the form or the data?? i saw this helper in many sites but i am confused...please help...
Harish Kurup
2009-12-16 07:58:36
Is the front-end side of things not working or is the value not being changed in the database ?
sjobe
2009-12-17 14:56:14
the frontend is not working (hence didnot try the backend..)...and is there anything to do in the controller??
Harish Kurup
2009-12-18 12:30:48
actually there are two templates, one which has the view(where we have the edit link/button), and on clicking edit the second template should open i.e edit. where i want to do the edit and on saving it should be back to view template. [the edit template will contain the form element]
Harish Kurup
2009-12-18 12:40:42
You've tried any methods like <?php echo input_in_place_editor_tag('edit_me', 'mymodule/myaction', array( 'cols' => 40, 'rows' => 10,))for in-place editing ?
sjobe
2009-12-18 15:31:39
yes i did, there was no error it was throwing but not working at all...
Harish Kurup
2009-12-19 11:21:29
A:
I think in-place-edit is best option here. I have used jeditable and jqeury in symfony to achieve similar functionality. Pl have a look at http://myimalert.com/stock_alerts
I could not find native support for in-place-edit in Symfony 1.4.
LionHeart
2010-09-06 05:09:54