Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by dm on Feb 08, 2009 10:26
open dhtmlx forum
datepicker form reload xml

Hello, I want to use a jquery UI datepicker to choose a range of dates and reload my XML accordingly. How do I send the values of the datepicker back to the sql query and reload the XML? I am using dynamic loading from a coldfusion file using sqlserver 2005. The datepicker is this one http://ui.jquery.com/demos/datepicker/

Seems like I need to attach an event, and then call the loadxml with ?val1&val2(the range of dates)
Answer posted by Alex on Feb 09, 2009 08:29

Hello,

Which dhtmlx component your question concerns ?

Answer posted by dm on Feb 10, 2009 04:04
Sorry it is the dhtmlxgrid
I want to use a jquery UI datepicker to choose a range of dates and reload my XML accordingly.

    <input type="text" name="startDate" id="startDate" value= "<cfoutput>#DateFormat("# Now()#", "mm/dd/yyyy")#</cfoutput>" />&nbsp;&nbsp;&nbsp;to &nbsp; <input type="text" name="endDate" id="endDate" value= "<cfoutput>#DateFormat("# Now()#", "mm/dd/yyyy")#</cfoutput>" />

<script type="text/javascript">
function customRange(input) {
    return {minDate: (input.id == "endDate" ? $("#startDate").datepicker("getDate") : null),
        maxDate: (input.id == "startDate" ? $("#endDate").datepicker("getDate") : null)};
}
</script>

How do I send the values of the datepicker back to the sql query and reload the XML?

 I am using dynamic loading from a coldfusion file using sqlserver 2005. The datepicker is this one http://ui.jquery.com/demos/datepicker/
Answer posted by Alex (support) on Feb 10, 2009 07:37

The grid can be reloaded using the following approach:

grid.clearAll();

grid.loadXML(...);

In order to send data to the server you can try to use our dhtmlxAjax component.

Answer posted by dm on Feb 10, 2009 09:23
Yep I got it, works really nice, just use the onclose event and then what you suggested, makes sense. What do you guys suggest when a person is using a MS SQL database and wants to use dynamic loading. I was reading  the big grid documentation and it looks as though  the database in the tutorial was mysql, using the LIMIT function. Just curious what you have found to work best
Answer posted by Support on Feb 10, 2009 09:58
>>What do you guys suggest when a person is using a MS SQL database
There are few solutions which can mimic LIMIT usage in case of MS SQL 
    http://www.salatti.net/how-to-emulate-limitfrom-to-with-mssql-2005/
    http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=850&lngWId=5
or you can use DB cursors to process only necessary rows ( the implementation depends on used server side platform ) 


Answer posted on Feb 10, 2009 10:18
Thanks for the tips, I am sure you have articles or questions on here to address paging too for limited data sets, in fact I think I saw one. Seems like you can use this system you made here for a complete database interface, its like crystal reports and excel wrapped into one.
Answer posted by Alex (support) on Feb 10, 2009 10:29
>>paging too for limited data sets
The paging uses the same server side as SmartRendering code ( the only difference is usage of enablePaging instead of enableSmartRendering in client side code )