EasyUI Forum
November 04, 2025, 01:20:14 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Why $(this).<plugin> sometimes does not work inside event calls.  (Read 7887 times)
mzeddd
Full Member
***
Posts: 223



View Profile
« on: October 05, 2015, 03:35:23 AM »

I just want to continue this topic: http://www.jeasyui.com/forum/index.php?topic=5275.0

This example works fine
Code:
$('#test').combotree({
multiple: true,
onlyLeafCheck:true,
onLoadSuccess: function(node,data){
var values = $('#test').combotree('getValues');
alert(JSON.stringify(values));
}
});

But if I change
Code:
$('#test').combotree('getValues')
to
Code:
$(this).combotree('getValues')
I get error:

Quote
TypeError: $.data(...) is undefined .... jquery.easyui.min.js:12401:9 (for 1.4.3)

At the same time if I change this line to
Code:
$(this).tree('getChecked')
or
$(this).tree('getSelected')
then it works, but works only in case if elements are loaded. In case if element is still selected after 'reload' call but not loaded I get [] what is wrong.
« Last Edit: October 05, 2015, 03:45:29 AM by mzeddd » Logged
mzeddd
Full Member
***
Posts: 223



View Profile
« Reply #1 on: October 06, 2015, 04:21:24 AM »

And the question is:
How I can redefine "onLoadSuccess" and other events in $.fn.combotree.defaults and use "getValues"-like functions via this and get access to all features I usually have when I know #object id?

I would like to have the same business logic for all combotree with only one place where it could be changed.
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!