EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 11, 2024, 08:18:38 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
Init a DateBox
Pages: [
1
]
« previous
next »
Print
Author
Topic: Init a DateBox (Read 5938 times)
yamilbracho
Jr. Member
Posts: 64
Init a DateBox
«
on:
November 01, 2014, 10:34:33 AM »
I am trying to read to a datebox
My datebox is defined as :
<input class="easyui-datebox"
name="fe_nacimiento"
required="true"
data-options="formatter:myformatter, parser:myparser">
and the code to get from database
var urlData = './get_data.php';
$.get(urlData, function(response) {
var response = eval('(' + response + ')');
alert(response.fe_nacimiento);
$("[name='fe_nacimiento']").datebox('setValue', response.fe_nacimiento);
})
The alert shows "2015-12-31", and the javascript console
Uncaught TypeError: Cannot read property 'options' of undefined
And the datebox is in blank. There are another fields that i bring from the database and
they are show in their text and combo boxes...
Any hint...
TIA
Yamil
Logged
yamilbracho
Jr. Member
Posts: 64
Re: Init a DateBox
«
Reply #1 on:
November 01, 2014, 01:20:48 PM »
Wow, I solved it!!!!
Just add an id to my datebox, say
<input class="easyui-datebox"
id="fe_nacimiento"
name="fe_nacimiento"
required="true"
data-options="formatter:myformatter, parser:myparser">
And change :
$("[name='fe_nacimiento']").datebox('setValue', response.fe_nacimiento);
to
$('#fe_nacimiento').datebox('setValue', fechaNac);
It looks like JEasyUI works better if your add an id to your inputs...
Regards,
Yamil
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...