Re: [fw-general] jQuery Ajax link inside container- how to make this?
Hi, just try to put into the loaded page: script type=text/javascript ?php echo $this-jQuery(); ? at the end of your code. And does it works. For some reason with out putting script start tag before JQuery it doesn't work. for example: div id=content style=overflow:auto; javascript:loadContent('?php echo $this- baseUrl; ?/viajesos/agregarviajeos'); Agregar Viaje One Shot br / /div pick your date: ?= $this-datePicker(dp1, '', array('defaultDate' = date('Y/m/d', time(; ? script type=text/javascript ?php echo $this-jQuery(); ? This is an phtml loaded from a dialogcontainer. Cheers. vladimirn wrote: Thanks. Can u just tell me why Edit and Delete are not inside a href in hello.phtml? It wont allow me to post how link looks like so i will improvize: href=# id=delete onclick=$.post('/admin/index/hello', {}, function(data, textStatus) { $('#contentJ').html(data); }, 'html');return false; [Delete] See? [Delete] is totally out of link tag. -- View this message in context: http://old.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p26261541.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] jQuery Ajax link inside container- how to make this?
I would like to figure this out: On my index.phtml page is a link: --- index.phtml ?=$this-jQuery ();? ?=$this-ajaxLink( Home, /admin/index/hello, array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? - end of index.phtml -- DIV contentJ is somwhere within same index.phtml page. This function calling my helloAction inside indexController where i have: part of indexController- helloAction- $news = $db-fetchAll ( $newssql ); $this-view-news = $news; end and my hello.phtml view script showing: hello.phtml - ?php foreach ( $this-news as $news ) :? ?php echo $news['date'].' - '.$news['postedBy']? nbsp;nbsp;nbsp;nbsp; ?php echo $this-ajaxLink( [ Edit ], /admin/index/edit, array( 'id' = 'edit', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? nbsp; ?php echo $this-ajaxLink( [ Delete ], /admin/index/delete, array( 'id' = 'delete', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? br ?php echo $news['newsText']? br br ?php endforeach; ? --end of hello.phtml --- SO far you can see that i tried to create 2 links inside hello.phtml. All data are displayed, but [ Edit ] and [ Delete ] links are not links at all, just plain text. Is it possible to make them as ajaxLink within given container (contentJ) and clicking on them, new content is pulled in contentJ div? Thanks a lot, V -- View this message in context: http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20703903.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] jQuery Ajax link inside container- how to make this?
You have to give dataType = html as additoinal parameter to the options, because for security by default ajax responses are handled as text. On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn [EMAIL PROTECTED] wrote: I would like to figure this out: On my index.phtml page is a link: --- index.phtml ?=$this-jQuery ();? ?=$this-ajaxLink( Home, /admin/index/hello, array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? - end of index.phtml -- DIV contentJ is somwhere within same index.phtml page. This function calling my helloAction inside indexController where i have: part of indexController- helloAction- $news = $db-fetchAll ( $newssql ); $this-view-news = $news; end and my hello.phtml view script showing: hello.phtml - ?php foreach ( $this-news as $news ) :? ?php echo $news['date'].' - '.$news['postedBy']? ?php echo $this-ajaxLink( [ Edit ], /admin/index/edit, array( 'id' = 'edit', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? ?php echo $this-ajaxLink( [ Delete ], /admin/index/delete, array( 'id' = 'delete', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? br ?php echo $news['newsText']? br br ?php endforeach; ? --end of hello.phtml --- SO far you can see that i tried to create 2 links inside hello.phtml. All data are displayed, but [ Edit ] and [ Delete ] links are not links at all, just plain text. Is it possible to make them as ajaxLink within given container (contentJ) and clicking on them, new content is pulled in contentJ div? Thanks a lot, V -- View this message in context: http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20703903.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] jQuery Ajax link inside container- how to make this?
THank you for your quick reply. Can you show me how to this, or point me somewhere where i can learn that please? And where to add that? array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST', 'dataType'='html' ) Like that? beberlei wrote: You have to give dataType = html as additoinal parameter to the options, because for security by default ajax responses are handled as text. On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn [EMAIL PROTECTED] wrote: I would like to figure this out: On my index.phtml page is a link: --- index.phtml ?=$this-jQuery ();? ?=$this-ajaxLink( Home, /admin/index/hello, array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? - end of index.phtml -- DIV contentJ is somwhere within same index.phtml page. This function calling my helloAction inside indexController where i have: part of indexController- helloAction- $news = $db-fetchAll ( $newssql ); $this-view-news = $news; end and my hello.phtml view script showing: hello.phtml - ?php foreach ( $this-news as $news ) :? ?php echo $news['date'].' - '.$news['postedBy']? ?php echo $this-ajaxLink( [ Edit ], /admin/index/edit, array( 'id' = 'edit', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? ?php echo $this-ajaxLink( [ Delete ], /admin/index/delete, array( 'id' = 'delete', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? br ?php echo $news['newsText']? br br ?php endforeach; ? --end of hello.phtml --- SO far you can see that i tried to create 2 links inside hello.phtml. All data are displayed, but [ Edit ] and [ Delete ] links are not links at all, just plain text. Is it possible to make them as ajaxLink within given container (contentJ) and clicking on them, new content is pulled in contentJ div? Thanks a lot, V -- View this message in context: http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20703903.html Sent from the Zend Framework mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20704281.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] jQuery Ajax link inside container- how to make this?
Well, i added dataType to all 3 links, but no changes at all vladimirn wrote: THank you for your quick reply. Can you show me how to this, or point me somewhere where i can learn that please? And where to add that? array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST', 'dataType'='html' ) Like that? beberlei wrote: You have to give dataType = html as additoinal parameter to the options, because for security by default ajax responses are handled as text. On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn [EMAIL PROTECTED] wrote: I would like to figure this out: On my index.phtml page is a link: --- index.phtml ?=$this-jQuery ();? ?=$this-ajaxLink( Home, /admin/index/hello, array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? - end of index.phtml -- DIV contentJ is somwhere within same index.phtml page. This function calling my helloAction inside indexController where i have: part of indexController- helloAction- $news = $db-fetchAll ( $newssql ); $this-view-news = $news; end and my hello.phtml view script showing: hello.phtml - ?php foreach ( $this-news as $news ) :? ?php echo $news['date'].' - '.$news['postedBy']? ?php echo $this-ajaxLink( [ Edit ], /admin/index/edit, array( 'id' = 'edit', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? ?php echo $this-ajaxLink( [ Delete ], /admin/index/delete, array( 'id' = 'delete', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? br ?php echo $news['newsText']? br br ?php endforeach; ? --end of hello.phtml --- SO far you can see that i tried to create 2 links inside hello.phtml. All data are displayed, but [ Edit ] and [ Delete ] links are not links at all, just plain text. Is it possible to make them as ajaxLink within given container (contentJ) and clicking on them, new content is pulled in contentJ div? Thanks a lot, V -- View this message in context: http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20703903.html Sent from the Zend Framework mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20704314.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] jQuery Ajax link inside container- how to make this?
Hello, i have looked at the issue again, and what you try to achieve is not really possible. Because ajaxLink generally creates jQuery javascript and attaches it to the jQuery stack which you render with ?= $this-jQuery(); ? in your view. Wenn you call the ajax content and return new links that are created with ajaxLink() their javascript cannot be attached to the jQuery stack anymore, because that has been rendered before. What you could try is the following, in the two links that are generated through the ajax request set in the options 'inline' = true, and in the previous linke set: 'dataType' = 'script', so that it would look like: Normally generated link: array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST', 'dataType'='script' ) Ajax Requested Link: ?php echo $this-ajaxLink( [ Edit ], /admin/index/edit, array( 'id' = 'edit', 'update' = '#contentJ', 'noscript' = false, 'inline' = true, 'method' = 'POST')); On Wednesday 26 November 2008 17:27:37 vladimirn wrote: Well, i added dataType to all 3 links, but no changes at all vladimirn wrote: THank you for your quick reply. Can you show me how to this, or point me somewhere where i can learn that please? And where to add that? array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST', 'dataType'='html' ) Like that? beberlei wrote: You have to give dataType = html as additoinal parameter to the options, because for security by default ajax responses are handled as text. On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn [EMAIL PROTECTED] wrote: I would like to figure this out: On my index.phtml page is a link: --- index.phtml ?=$this-jQuery ();? ?=$this-ajaxLink( Home, /admin/index/hello, array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? - end of index.phtml -- DIV contentJ is somwhere within same index.phtml page. This function calling my helloAction inside indexController where i have: part of indexController- helloAction- $news = $db-fetchAll ( $newssql ); $this-view-news = $news; end --- - and my hello.phtml view script showing: hello.phtml - ?php foreach ( $this-news as $news ) :? ?php echo $news['date'].' - '.$news['postedBy']? ?php echo $this-ajaxLink( [ Edit ], /admin/index/edit, array( 'id' = 'edit', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? ?php echo $this-ajaxLink( [ Delete ], /admin/index/delete, array( 'id' = 'delete', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? br ?php echo $news['newsText']? br br ?php endforeach; ? --end of hello.phtml --- SO far you can see that i tried to create 2 links inside hello.phtml. All data are displayed, but [ Edit ] and [ Delete ] links are not links at all, just plain text. Is it possible to make them as ajaxLink within given container (contentJ) and clicking on them, new content is pulled in contentJ div? Thanks a lot, V -- View this message in context: http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-thi s--tp20703903p20703903.html Sent from the Zend Framework mailing list archive at Nabble.com. -- Benjamin Eberlei http://www.beberlei.de
Re: [fw-general] jQuery Ajax link inside container- how to make this?
I went thru http://framework.zend.com/manual/en/zendx.jquery.view.html#zendx.jquery.view.helpers.ajaxlink and it says that dataType = html is default. However, i explicitly gave this to my ajaxLink and still wont work. I tried to change to dataType=text and i am getting code of my hello.phtml However links inside hello.phtml still wont work. Can anyone help me on this please? :) -- View this message in context: http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20704908.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] jQuery Ajax link inside container- how to make this?
Thank you for reply. I tried to set up like this, but still wont work. I think that would be big deal to make such thing to work, so one can use ajaxLink inside container requested by another ajaxLInk. Is there anything else i can try? i would not like to abandon this, cause i think its a great idea, so i will ask for help one more time ;) Thanks, V beberlei wrote: Hello, i have looked at the issue again, and what you try to achieve is not really possible. Because ajaxLink generally creates jQuery javascript and attaches it to the jQuery stack which you render with ?= $this-jQuery(); ? in your view. Wenn you call the ajax content and return new links that are created with ajaxLink() their javascript cannot be attached to the jQuery stack anymore, because that has been rendered before. What you could try is the following, in the two links that are generated through the ajax request set in the options 'inline' = true, and in the previous linke set: 'dataType' = 'script', so that it would look like: Normally generated link: array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST', 'dataType'='script' ) Ajax Requested Link: ?php echo $this-ajaxLink( [ Edit ], /admin/index/edit, array( 'id' = 'edit', 'update' = '#contentJ', 'noscript' = false, 'inline' = true, 'method' = 'POST')); On Wednesday 26 November 2008 17:27:37 vladimirn wrote: Well, i added dataType to all 3 links, but no changes at all vladimirn wrote: THank you for your quick reply. Can you show me how to this, or point me somewhere where i can learn that please? And where to add that? array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST', 'dataType'='html' ) Like that? beberlei wrote: You have to give dataType = html as additoinal parameter to the options, because for security by default ajax responses are handled as text. On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn [EMAIL PROTECTED] wrote: I would like to figure this out: On my index.phtml page is a link: --- index.phtml ?=$this-jQuery ();? ?=$this-ajaxLink( Home, /admin/index/hello, array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? - end of index.phtml -- DIV contentJ is somwhere within same index.phtml page. This function calling my helloAction inside indexController where i have: part of indexController- helloAction- $news = $db-fetchAll ( $newssql ); $this-view-news = $news; end --- - and my hello.phtml view script showing: hello.phtml - ?php foreach ( $this-news as $news ) :? ?php echo $news['date'].' - '.$news['postedBy']? ?php echo $this-ajaxLink( [ Edit ], /admin/index/edit, array( 'id' = 'edit', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? ?php echo $this-ajaxLink( [ Delete ], /admin/index/delete, array( 'id' = 'delete', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? br ?php echo $news['newsText']? br br ?php endforeach; ? --end of hello.phtml --- SO far you can see that i tried to create 2 links inside hello.phtml. All data are displayed, but [ Edit ] and [ Delete ] links are not links at all, just plain text. Is it possible to make them as ajaxLink within given container (contentJ) and clicking on them, new content is pulled in contentJ div? Thanks a lot, V -- View this message in
Re: [fw-general] jQuery Ajax link inside container- how to make this?
Just to add this: i looked at source after clicked on first ajaxLink and i have this: # [ Edit ]nbsp; # [ Delete ] Somehow, [ Edit ] is out of a href tags.. -- View this message in context: http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20705645.html Sent from the Zend Framework mailing list archive at Nabble.com.
Re: [fw-general] jQuery Ajax link inside container- how to make this?
you should probably generalize your jQuery link by writing that on your own. This way you can supply the needed jQuery code already in your main view. I cannot come up with another idea how that would work with the ajaxLink helper. Sorry :-) On Wednesday 26 November 2008 18:34:15 vladimirn wrote: Thank you for reply. I tried to set up like this, but still wont work. I think that would be big deal to make such thing to work, so one can use ajaxLink inside container requested by another ajaxLInk. Is there anything else i can try? i would not like to abandon this, cause i think its a great idea, so i will ask for help one more time ;) Thanks, V beberlei wrote: Hello, i have looked at the issue again, and what you try to achieve is not really possible. Because ajaxLink generally creates jQuery javascript and attaches it to the jQuery stack which you render with ?= $this-jQuery(); ? in your view. Wenn you call the ajax content and return new links that are created with ajaxLink() their javascript cannot be attached to the jQuery stack anymore, because that has been rendered before. What you could try is the following, in the two links that are generated through the ajax request set in the options 'inline' = true, and in the previous linke set: 'dataType' = 'script', so that it would look like: Normally generated link: array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST', 'dataType'='script' ) Ajax Requested Link: ?php echo $this-ajaxLink( [ Edit ], /admin/index/edit, array( 'id' = 'edit', 'update' = '#contentJ', 'noscript' = false, 'inline' = true, 'method' = 'POST')); On Wednesday 26 November 2008 17:27:37 vladimirn wrote: Well, i added dataType to all 3 links, but no changes at all vladimirn wrote: THank you for your quick reply. Can you show me how to this, or point me somewhere where i can learn that please? And where to add that? array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST', 'dataType'='html' ) Like that? beberlei wrote: You have to give dataType = html as additoinal parameter to the options, because for security by default ajax responses are handled as text. On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn [EMAIL PROTECTED] wrote: I would like to figure this out: On my index.phtml page is a link: --- index.phtml ?=$this-jQuery ();? ?=$this-ajaxLink( Home, /admin/index/hello, array('update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? - end of index.phtml -- DIV contentJ is somwhere within same index.phtml page. This function calling my helloAction inside indexController where i have: part of indexController- helloAction- $news = $db-fetchAll ( $newssql ); $this-view-news = $news; end --- - and my hello.phtml view script showing: hello.phtml - ?php foreach ( $this-news as $news ) :? ?php echo $news['date'].' - '.$news['postedBy']? ?php echo $this-ajaxLink( [ Edit ], /admin/index/edit, array( 'id' = 'edit', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? ?php echo $this-ajaxLink( [ Delete ], /admin/index/delete, array( 'id' = 'delete', 'update' = '#contentJ', 'noscript' = false, 'method' = 'POST')); ? br ?php echo $news['newsText']? br
Re: [fw-general] jQuery Ajax link inside container- how to make this?
Thanks. Can u just tell me why Edit and Delete are not inside a href in hello.phtml? It wont allow me to post how link looks like so i will improvize: href=# id=delete onclick=$.post('/admin/index/hello', {}, function(data, textStatus) { $('#contentJ').html(data); }, 'html');return false; [Delete] See? [Delete] is totally out of link tag. -- View this message in context: http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20705922.html Sent from the Zend Framework mailing list archive at Nabble.com.