道场网格按日期过滤

发布于 2024-09-27 06:05:49 字数 845 浏览 0 评论 0原文

这是我的问题:

我有一个网格,显示记录列表以及记录日期。考虑到这一点,我创建了一个过滤器表单,允许用户根据日期过滤数据。这里的问题是如何过滤日期。这是我到目前为止所拥有的:

MyGrid 是从我的数据存储区填充的:

recordsStore:  new dojo.data.ItemFileWriteStore({

url: "xhreq?action=getRecords",
clearOnClose:true,
urlPreventCache:true });

在我的表格布局中,我使用 dateTextBox 供用户添加要过滤的日期:

{ 名称:“日期”, 字段:“日期”, 宽度:“10em”,
类型:dojox.grid.cells.DateTextBox, 格式化程序:格式化日期对象, 约束:{ 日期模式:'MM/dd/yyyy', 格式长度:'短', 选择器:'日期'}, 可编辑:真 },

这就是我开始过滤日期的方式: 从网格中过滤数据:

doFilter: 函数() { filter_standby.show();

日期 = "*";

if(filter_inDateFrom.attr("值") != "" || filter_inDateThrough.attr("值") != ""){ { 总天数 = inDateThru - inDateFrom;店铺总天数 日期 = 日期 + 总天数; // 根据总天数过滤 }

现在有没有办法返回一个范围内的日期?如果不是,处理日期的最佳方法是什么?

谢谢

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 filter 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文