EasyUI Forum
September 14, 2025, 08:20:51 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Way to use "Form onLoadSuccess event"  (Read 12843 times)
bakoma
Newbie
*
Posts: 13


View Profile Email
« on: July 05, 2014, 05:49:49 PM »

I need to do something after "Form onLoadSuccess event". I cannot find an example about how to use it.

Originally, I tried:
$('#myform').form('load', 'mywebservice.php');
myFunctionToDoSomethingWithFormFields();

but myFunctionToDoSomethingWithFormFields() just executed too soon before the form being filled data from webservice.

Now I am doing:
$('#myform').form('load', 'mywebservice.php');
window.setTimeout(function () {
   myFunctionToDoSomethingWithFormFields();
}, 1000);

assuming the data will be filled into the from within 1 second. This is just a workaround.

Although the document says there is a onLoadSuccess event, there is no example showing the usage.

I tried the following with no luck:
$('#myform').form('load', 'mywebservice.php',{onLoadSuccess:' myFunctionToDoSomethingWithFormFields();'});

$('#myform').onLoadSuccess=function(){
    myFunctionToDoSomethingWithFormFields();
};
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: July 06, 2014, 01:43:58 AM »

Please try this:
Code:
$('#myform').form({
onLoadSuccess:function(data){
console.log(data)
}
});
$('#myform').form('load','mywebservice.php')
Logged
bakoma
Newbie
*
Posts: 13


View Profile Email
« Reply #2 on: July 07, 2014, 09:06:46 AM »

It works great!. Thanks  a lot.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!