jQWidgets Forums
Forum Replies Created
-
Author
-
Hi Peter,
I use correct syntax, Inly wrote wrong to form.
At below example, startdate is a div defined at rendertoolbar for which jquerydatetimeinput is applied, but I dont see anything at url called startdate. If I defined div at html body I see itprocessdata: function (data) {
data.startdate= $(“#startdate”).val();
}Hi Peter,
Now it is ok, I am using below code and it works
var mydate = $(“#mydate”).jqxDateTimeInput({ width: ‘120px’, height: ’25px’, animationType: ‘fade’ });
processdata: function (data) {
data.startdate= mydate.val();
}But there is very critical point for me.
If I define div of datetimeinput at toolbar with rendertoolbar property as follow::
rendertoolbar: function (toolbar) {
var container = $(““);
var span_start = $(“
“);
/>”);var s_date = span_start.jqxDateTimeInput({ width: ‘120px’, height: ’25px’, animationType: ‘fade’ });
….
….
}When I write below code to pass datetimeinput of which div part defined at rendertoolbar , it does not pass to url
v
processdata: function (data) {
data.startdate= $(“startdate”).val();
}As a result, there is no problem to pass value to url if div ofdatetimeinput is defined at html, but it is problem if it is defined at rendertoolbar.
Hi Peter,
Thanks a lot. Dynamic parameter passed to url by using formatdata as follow.
formatdata: function (data) {
return {‘stdate’: datemy.val()};
}But this time, I dont see grid parameter at URL although databound is used. There is only stdate at url as parameter. Using formatdata prevented grid parameters to be at URL
Hi Peter,
I understood the difference between dataBind of dataAdapter and updateBoundData.
There is no problem to pass static parameter to json url with ajax request as follow:var source =
{
…………
………….
data: {
featureClass: “P”,
style: “full”,
maxRows: 50
}
};I have problem to pass dynamic parameter to json url as follow
var mydate = $(“#mydate”).jqxDateTimeInput({ width: ‘120px’, height: ’25px’, animationType: ‘fade’ });var source =
{
…………
………….
data: {
mydate: mydate.val()
}
};Another question is that, suppose that I appended my datetimeinput to toolbar of grid, then can we assume that datetimeinput is a membr of grid and databound is enough to pass value of it to url without using databind?
Hi Peter,
Thanks for quick reply.
When I commented out dataAdapter.dataBind() and added $(‘#jqxgrid’).jqxGrid(‘updatebounddata’) as below, I saw that correct pagesize parameter is passed to url when I clicked on button.$(“button”).click(function () {
//dataAdapter.dataBind();
$(‘#jqxgrid’).jqxGrid(‘updatebounddata’);
});
But the parameter stdate which is datetimeinput is not passed to url with new paramater.
var source = {
datatype: “json”,
datafields: [
{ name: ‘CategoryID’, type: ‘int’ },
{ name: ‘Category’ },
{ name: ‘Updated’ },
],
id: ‘CategoryID’,
url: url,
data: {
stdate: mydate.jqxDateTimeInput(‘getDate’).getMonth(),
}
};I will also analysize what is the difference between databound and databind because when I used databound instead of databind with your offer I saw that reqest to server has been performed again. Then I will search what is the meaning of databind.
To explain clearly, I am writing my source below:
var mydate = $(“#mydate”).jqxDateTimeInput({ width: ‘120px’, height: ’25px’, animationType: ‘fade’ });
// prepare the data
var source = {
datatype: “json”,
datafields: [
{ name: ‘CategoryID’, type: ‘int’ },
{ name: ‘Category’ },
{ name: ‘Updated’ },
],
id: ‘CategoryID’,
url: url,
data: {
stdate: mydate.jqxDateTimeInput(‘getDate’).getMonth(),
}
};After I change date from mydate.jqxDateTimeInput, I click on a button, call databind and I want stdate to set the value of date selected from jqxDateTimeInput but it is not. It is always sent to server with value of initial.
-
AuthorPosts