Note that there are some explanatory texts on larger screens.

plurals
  1. POcakephp elements and Ajax update
    primarykey
    data
    text
    <p>here is what i am trying to achieve...</p> <p>i have a index view in which i have used the ajax helper not the cakephp one but an external one from <a href="http://www.cakephp.bee.pl/" rel="nofollow">http://www.cakephp.bee.pl/</a></p> <p>i have succefully created an accordion using this helper.</p> <p>now inside the accordion i have an addbutton which submits a form via ajax.</p> <p>what i would like to do is when i submit the ajax form. i would also like to update the accordion. now the accordion is also created by using the ajax helper. </p> <p>Can this be done without a page refresh</p> <p>ajax submit form code :</p> <pre><code> &lt;div class="qnotesform"&gt; &lt;?php echo $this-&gt;Form-&gt;create('Qnote');?&gt; &lt;ul class="qnotelist"&gt; &lt;li&gt;&lt;?php echo $this-&gt;Form-&gt;input('Qnote.subject', array('label'=&gt;'Title', 'rows' =&gt; '1')); ?&gt;&lt;/li&gt; &lt;li&gt; &lt;?php echo $this-&gt;Form-&gt;input('Qnote.body', array('label'=&gt;'Header', 'rows' =&gt; '1')); ?&gt;&lt;/li&gt; &lt;?php echo $this-&gt;Form-&gt;hidden('Qnote.user_id', array('value'=&gt;Authsome::get('id'))); ?&gt; &lt;?php echo $this-&gt;Form-&gt;hidden('Step.0.user_id', array('value'=&gt;Authsome::get('id'))); ?&gt; &lt;li&gt;&lt;?php echo $this-&gt;Form-&gt;input('Step.0.body', array('label'=&gt;'Steps' ,'class' =&gt; 'step', 'rows' =&gt; '1')); ?&gt;&lt;/li&gt; &lt;/ul&gt; &lt;?php echo $ajax-&gt;submit( 'Submit', array( 'url' =&gt; array( 'controller'=&gt;'qnotes', 'action'=&gt;'add') )); </code></pre> <p>how can i achieve this . could someone please point me the right direction </p> <p>another thing that i want to clear out is. If i want to be working one page . and all crud action to be used without a page refresh. </p> <p>does anybody have a working example for the above senarios . or let me make it simple. how to refresh a div without refreshing the page.</p> <p>Solution:</p> <p>code</p> <pre><code> &lt;?php echo $ajax-&gt;submit('Submit', array( 'url'=&gt; array( 'controller'=&gt;'qnotes', 'action'=&gt;'add'), 'update'=&gt;'leftdiv', 'after'=&gt;'$("#accordion").accordion({autoHeight: false, collapsible: true , header: "h3"});alert("after");', )); </code></pre> <p>however now I am facing another issue now, I am updating the accordion, everything works fine but as soon as update the accordion. the accordion loses its style class and stops working. I only see links then. any idea how. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload