Issue in checkbox and date type in json response

80 views
Skip to first unread message

Dharmesh Mistry

unread,
Jun 26, 2014, 4:12:52 AM6/26/14
to jquery...@googlegroups.com
Hey guys,

Here i attached demo file and that i facing proble to render date type and checkbox in that 
In my json response is 

{
            "scope":"global",
            "name":"notEnoughInformation",
            "value":false,
            "type":"boolean"
            },
            {
            "scope":"global",
            "name":"initiator",
            "value":"kermit",
            "type":"string"
            },
            {
            "name": "birthdate"
            "type": "date"
            'value": "2014-06-24T07:00:00Z"
            "scope": "global"
            },

in that i also come up with type:string and caption  you can see in the attched file.

but i m facing problem for type:date and checkbox..how can we render in the html form



Issue.txt

Dharmesh Mistry

unread,
Jun 26, 2014, 4:15:55 AM6/26/14
to jquery...@googlegroups.com
Complete json response for render:

{"data":
[
{"scope":"global","name":"isMarried","value":true,"type":"boolean"},
{"scope":"global","name":"birthdate","value":"2014-06-24T07:00:00Z","type":"date"},
{"scope":"global","name":"lastname","value":"Test","type":"string"},
{"scope":"global","name":"firstname","value":"Test","type":"string"},
{"scope":"global","name":"education","value":"mba","type":"string"}
]

David Luecke

unread,
Jun 26, 2014, 11:02:48 AM6/26/14
to jquery...@googlegroups.com
Besides some syntax errors in the example code, there was also the problem that a checkbox is `<input type="checkbox" />` not `<checkbox>` it is probably the same for dates. Here is a Fiddle that should work:



--
You received this message because you are subscribed to the Google Groups "jQuery dForm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jquery-dform...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dharmesh Mistry

unread,
Jun 26, 2014, 11:13:14 AM6/26/14
to jquery...@googlegroups.com
Thanks a lot for prompt reply it helps me lot.But i want it to checkbox as true 
as described in JSON Response

Regards
Dharmesh Mistry

David Luecke

unread,
Jun 26, 2014, 11:15:57 AM6/26/14
to jquery...@googlegroups.com
I'm not sure I understand the question but to mark the checkbox checked used jQuery $().prop('checked', boolean):

Dharmesh Mistry

unread,
Jun 26, 2014, 11:47:23 AM6/26/14
to jquery...@googlegroups.com
Hi,

daff 
thanks man
i m new to dform and  I checked above option for  jQuery $().prop('checked', boolean):
It works good and helps a lot in my project.

now this works for the static data json

But if want to use json that comes from the server or some other page so how can we generate that dynamically form .

David Luecke

unread,
Jun 26, 2014, 11:48:57 AM6/26/14
to jquery...@googlegroups.com
As pointed out in the documentation (http://daffl.github.io/jquery.dform/#plugin/jquery-plugin-methods) you can run $(form).dform(url [, success], [, error]) with a URL to a JSON object.

Dharmesh Mistry

unread,
Jun 27, 2014, 4:53:52 AM6/27/14
to jquery...@googlegroups.com
Hey deff,

Now i am Stuck in the css .

I want to use jquery easyUI  css and its datepicker for it so how can i customize according to that css and datepicker for that.

Dharmesh Mistry

unread,
Jun 27, 2014, 6:48:26 AM6/27/14
to jquery...@googlegroups.com
I also come up with change in text box by chande class for that and $.dform.options.prefix = false;.
But i have still problem in datepicker issue and check box and its label.
jquery.easyui.min.js
easyui.css

David Luecke

unread,
Jun 27, 2014, 10:30:29 AM6/27/14
to jquery...@googlegroups.com
Please put your examples into a JSFiddle otherwise it is hard to help.

Also, the CSS will work exactly the same way as if you were using it without dform so this might even be more of a question for the easy UI team.
Reply all
Reply to author
Forward
0 new messages