Here is my problem:
I have a grid that displays a list of records along with the date of the record. With that in mind I created a filter form that will allow the user to fi开发者_如何学编程lter the data based on the dates. The problem here is how can I filter the dates. Here is what I have so far:
MyGrid is populated from my datastore:
recordsStore: new dojo.data.ItemFileWriteStore({
url: "xhreq?action=getRecords",
clearOnClose: true, urlPreventCache: true });Inside my tablelayout I am using the dateTextBox For the user to add a date to filter on:
{ name : "Date", field : "Date", width : "10em",
type : dojox.grid.cells.DateTextBox, formatter : formatDateObject, constraint : { datePattern : 'MM/dd/yyyy', formatLength : 'short', selector : 'date'}, editable: true },this is how I started working on filtering on my dates: filter data from grid:
doFilter: function() { filter_standby.show();
inDate = "*";
if(filter_inDateFrom.attr("value") != "" || filter_inDateThrough.attr("value") != ""){ { totalDays = inDateThru - inDateFrom; store totalDays date = date + totalDays; // filter based on total days }
Now is there a way to return the dates within a range? if not what is the best way to handle the dates?
Thanks
精彩评论