EasyUI Forum
September 18, 2024, 07:19:48 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: How to specify success function for loader  (Read 5120 times)
zolotoy
Jr. Member
**
Posts: 89


View Profile Email
« on: July 28, 2015, 08:53:54 AM »

I am trying to adapt the following example:
http://jsfiddle.net/dvAcu/

My goal is to load data when a node is expanded. How would I return data back to loader's success function if I am getting data into a callback?
I wrote something like this for testing:
Code:
loader:function(param,success,error){
                    if (!param.id)
                        promise = assetsMVCService.execute("assetprojectstatus", { assetId: 1, dataFormat: 'attribute' });
                    else
                        promise = assetsMVCService.execute("assetprojectstatus", { assetId: param.id, dataFormat: 'attribute' });
                    //promise.then(scope.assetChildren);
                    success(promise.then(scope.assetChildren)); // tried that, not working
                },

Initially data is loaded because param.id does not exist. When I click on a node I am getting into scope.assetChildren function but returning data from it is not working.
I dont see it and the node that's been expanded stays closed.

Please share some ideas.

Thanks
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!