Hi Marc,<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
I assume that this class will be added only if $cfg['AjaxEnable'] is true.<br>
<div class="im"><br></div></blockquote><div> </div><div>Yes.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
</div>I suggest going for #2, provided this is done via AJAX (only refresh the<br>
usersForm by obtaining the new list from a call to server_privileges.js).<br>
<br>
So in server_privileges.php starting at line 2142, instead of using echo<br>
to generate the form, it would be gathered in a variable using a logic<br>
similar to the one in server_privileges.php starting at line 1357.<br>
Then it's either echoed if not coming from an ajax request, or sent via<br>
PMA_ajaxResponse().<br><br></blockquote><div><br></div><div>I went through the process which you have mentioned above. I have replaced echo with collecting variable called $user_form and then handled the ajax_enabeled action as follows. </div>
<div><br></div><div>if($GLOBALS['is_ajax_request'] == true){</div><div> $extra_data['user_form'] = $user_form;</div><div> $message = PMA_Message::success(__('New user has been added.'));</div>
<div> PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);</div><div> }</div><div><br></div><div>And in my server_privileges.js file I have called the post method as follows. </div><div>$testing_parameters = "db=super_store&server=1&token=c6ad5e8e3a8042287e401dc5e739280a&checkprivs=super_store&viewing_mode=db&ajax_request=true";</div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><div>$.post( $form.attr('action'), <meta http-equiv="content-type" content="text/html; charset=utf-8">$testing_parameters, function(mydata){</div>
<div> <span class="Apple-tab-span" style="white-space:pre"> </span>$("#usersForm").append(mydata);</div><div>}); </div></div><br clear="all">I have used hard coded parameters in <meta http-equiv="content-type" content="text/html; charset=utf-8">$testing_parameters variable and the append the datafor $("#uerForm") for test the feature. <div>
<br></div><div>But the appended my data does not returns an json object. it just return a string containing the results. I have share screen shots of the alert and the UI which shows the returned $mydata string with this doc [1]. Can you help me on why this happens. </div>
<div><br></div><div>If I'm not going to use the PMA_ajaxResponse() method I can just take the whole post data and extract the new #usersForm out of that and repalace the old one. </div><div><br></div><div>Please help me on this issue. Thank you.</div>
<div><br></div><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>[1] - <a href="https://docs.google.com/document/d/1DLcwm4VJv-IrLBiwlRwFPs4oaSuC_bPOsxrJ99xWB8Y/edit?hl=en_US&authkey=CKLN4fUP">https://docs.google.com/document/d/1DLcwm4VJv-IrLBiwlRwFPs4oaSuC_bPOsxrJ99xWB8Y/edit?hl=en_US&authkey=CKLN4fUP</a> </div>
<div><br></div><div>Regards,</div><div>Thilanka. </div><div><br>-- <br><div><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px"><div style="text-align:left">L G Thilanka Kaushalya <br>Computer Science & Engineering, <br>
<div style="color:rgb(80, 0, 80)">University of Moratuwa,<br>Sri Lanka<span></span><br> <br></div></div>Connect with me at,<br> Gmail : <a href="mailto:lgtkaushalya@gmail.com" style="color:rgb(0, 0, 204)" target="_blank">lgtkaushalya@gmail.com</a><br>
Twitter : @thilanka_k<br> Facebook : Thilanka Kaushalya<br> Yahoo : <a href="mailto:lgtkaushalya@yahoo.com" style="color:rgb(0, 0, 204)" target="_blank">lgtkaushalya@yahoo.com</a></span></div>
<div> Blog : <a href="http://coders-view.blogspot.com/" target="_blank">http://coders-view.blogspot.com/</a></div><br><br>
</div>