jQuery UI Widgets › Forums › Grid › passing user selected values to json file
This topic contains 1 reply, has 2 voices, and was last updated by ivailo 8 years, 10 months ago.
-
Author
-
Dear All,
this is the first time am participating in this forum.
downloaded jqwidgets 4.1.1 recently. been exploring, and trying it out since then.
I tried to use the grid with json. works like a charm.
var url = “MyFile-json.asp”;
// getting the data ready
var source =
{
datatype: “json”,
datafields: [
{ name: ‘tID’, type: ‘int’ },
{ name: ‘tDate’, type: ‘date’ },
{ name: ‘SID’, type: ‘int’ },
{ name: ‘Security’, type: ‘string’ },
{ name: ‘Client’, type: ‘string’ },
{ name: ‘ClientName’, type: ‘string’ }
],
url: url
};
var dataAdapter = new $.jqx.dataAdapter(source);So Far So Good.
i used the datetime widget to enable the user to select a particular date.
<label>Date Input</label>
<div id=’tDate’></div>
<input name=”btnSubmit” type=”submit” value=”Refresh”>i receive the selected date in a variable selectedDate like this.
<% dim selectedDate
selectedDate = Request.QueryString(“selDate”)and this selectedate date will be used to get records for that particular date. so i need to modify my url variable to look like this.
var url = “MyFile-json.asp?selDate=”+??????;
this is the part where i am lost.
i tried to alert the date on this page using the following code
var tDate1;
tDate1 = document.getElementById(‘tDate’);
alert(tDate1.value);this alert shows nothing. so am not sure how to trap this.
Another issue i have is. i want to tDate to show the date “22-Feb-2016” in the calendar. how do i do that.
all that i can do is <div id=’tDate’></div> but if i want tDate to show a certain date how do i do that.
Thanks
Hi vinod,
You can send parameters to the server with setting the data property of your source object.
Please, look at this demo.To get the value of some widget – use it’s val() method.
To change the way of displaying use formatString property jqxDateTimeInput.
Here is a demo.Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.