EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Opan Mustopah on January 23, 2015, 04:30:21 AM



Title: can't get textbox object in numberbox
Post by: Opan Mustopah on January 23, 2015, 04:30:21 AM
hello all,

just simple question, why i can't get the textbox object in numberbox plugin with textbox method?

here is my code:
Code:
$('#length1').numberbox('textbox').bind('blur',function(e){
      console.log(this);
    });

and here errors message on firebug console:

Code:
TypeError: $.data(...) is undefined


return $.data(jq[0],"textbox").textbox.find(".textbox-text");

what i want is to binding numberbox element to blur event using jquery method.
can you tell me where is wrong from my code?

many thanks for the answer


Title: Re: can't get textbox object in numberbox
Post by: stworthy on January 23, 2015, 09:10:54 AM
If you have not created the numberbox component, please create it before calling any methods.
Code:
$('#length1').numberbox().numberbox('textbox').bind('blur',function(e){
      console.log(this);
});


Title: Re: can't get textbox object in numberbox
Post by: Opan Mustopah on January 23, 2015, 07:51:21 PM
thanks stworthy,
but why i must recreate numberbox again? instead length1 is already a numberbox component?
i create numberbox component using html


Title: Re: can't get textbox object in numberbox
Post by: stworthy on January 24, 2015, 01:00:59 AM
Once you have created the numberbox component, you do not need to recreate it again.