首页 \ 问答 \ 基于日期的角度ui-grid过滤为null或不为null(Angular ui-grid filtering based on date is null or not null)

基于日期的角度ui-grid过滤为null或不为null(Angular ui-grid filtering based on date is null or not null)

在我的应用程序中,我使用Angular ui-grid以网格格式显示数据集。 我想根据名为actionDate的Date字段过滤这些数据。 我想过滤actionDatenull或非not null 。 我使用一个简单的下拉列表来选择它。

但是当此actionDate字段不为null时,过滤不起作用。 我认为这不起作用的原因是actionDate字段具有不同的值,并且ui-grid过滤器无法理解这一点。

我在下面的plunker中重现了这个问题。 http://plnkr.co/edit/8rIJeA92hDYQ9vHDUC1C?p=preview

感谢是否有人能指出我正确的方向。


In my application i am using Angular ui-grid to display set of data in a grid format . I want to filter these data based on a Date field called actionDate . I want to filter data where the actionDate is null or not null. I am using a simple dropdown to select this .

But the filtering doesn't work when this actionDate field is not null . I think the reason this doesn't work is that the actionDate field has different values and the ui-grid filter fails to understand that .

I have reproduced this issue in the following plunker. http://plnkr.co/edit/8rIJeA92hDYQ9vHDUC1C?p=preview

Appreciate if anyone can point me in the right direction .


原文:https://stackoverflow.com/questions/35522819
更新时间:2023-04-20 14:04

最满意答案

在客户端和服务器套接字上禁用Nagle算法修复了这个问题:

s = TCPServer.new( 4545 )
while( c = s.accept )
  c.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
  while( m = c.gets )
    c.puts( m.chomp )
  end
end
s.close

导致:

% ruby test_client.rb
Reconnect: 0.189858182s
Persistent: 0.030973398s

希望这可以帮助某人。


Disabling Nagle's algorithm on both the client and server sockets fixes this:

s = TCPServer.new( 4545 )
while( c = s.accept )
  c.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
  while( m = c.gets )
    c.puts( m.chomp )
  end
end
s.close

Resulting in:

% ruby test_client.rb
Reconnect: 0.189858182s
Persistent: 0.030973398s

Hope this helps someone.

相关问答

更多
  • 在客户端和服务器套接字上禁用Nagle算法修复了这个问题: s = TCPServer.new( 4545 ) while( c = s.accept ) c.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) while( m = c.gets ) c.puts( m.chomp ) end end s.close 导致: % ruby test_client.rb Reconnect: 0.189858182s Persi ...
  • 你应该尝试(过滤)商店: import simpy def user(machine): m = yield machine.get() print(m) yield machine.put(m) m = yield machine.get(lambda m: m['id'] == 1) print(m) yield machine.put(m) m = yield machine.get(lambda m: m['health'] > 98) ...
  • 你是否考虑过使用原始的long - > Object-map和原始的int-set作为值来实现多部分? Have you considered implementing the multi-portion yourself using a primitive long -> Object-map and primitive int-set as the value?
  • 正如文档所说,UdpClient / TcpClient是Socket类之上的一个薄包装器。 如果你想要做的只是发送/接收blob数据,那么这些类很好。 在这种情况下,Socket和UdpClient / TcpClient在性能上没有差别。 但是,Socket以XXXAsync()方法的形式提供了更快速的IO方法。 这些方法允许您执行非常快速的I / O,并且不会在TcpClient / UdpClient中公开。 这就是文档通过“perf差异”所表达的意思 - 对于更快的perf,您将不得不挖掘Sock ...
  • 不,至少对于iOs存在一些差异。 与安装的应用程序相比,您将在浏览器中获得更好的性能。 在iOs中,在Safari中有一个更快的javascript引擎启用,但在webview中没有。 在Android上也有不同之处:用户将使用chrome,但android中的嵌入式webkit比chrome的webkit更旧。 在Android中会有更多的错误和更糟糕的表现。 但差异大多不是那么大。 No, there are some differences at least for iOs. There you wi ...
  • 有一个选项你没有包括:在C中扩展Ruby相当容易,所以如果你有一组需要快速的操作,你可以编写一个C扩展,然后使用Ruby的。 http://people.apache.org/~rooneg/talks/ruby-extensions/ruby-extensions.html There's one option you didn't include: It's rather easy to extend Ruby in C, so if you have a limited set of operatio ...
  • 要说出你遇到的瓶颈有点难以理解。 您可以探索几种可能性: 您可能已经达到了流程中打开文件句柄数量的限制。 您的Linux内核使用每个进程配置的最大文件句柄数进行编译(套接字连接使用文件句柄。)您可以通过运行“ulimit -a”来查看(max)打开文件限制。 您可以在运行流程之前增加此数量,只需google“ulimit open files”。 另一个想法......在任何给定时间你有多少条消息? 您正在执行数据库查询以检索每个新连接的所有这些。 因此,如果连接数量急剧增加,您可能只是为了加载初始列表而进 ...
  • 在大多数现代CPU中,“特定指令的循环时间”的概念并不是特别有用。 管道将同时处理多个指令,它们将竞争CPU内部的各种资源 - 因此只能在周围指令的上下文中理解给定指令的性能。 即使是处理器系列中的不同型号,细节也会有很大差异。 此外,如果您正在做任何涉及数据的事情,那么缓存行为可能与指令执行时间一样重要。 对于x86:看看Agner Fog的“软件优化资源” 。 On most modern CPUs, the concept of "cycle time for a particular instruc ...
  • 在这种情况下,您可以使用select而不是count,该属性可以作为product.sold_quantity访问 查询变为 products = current_project.products.joins(:product_characteristics).group('products.id').select(:title, 'SUM(product_characteristics.sold_quantity) AS sold_quantity') products.first.sold_quant ...
  • 正如@theTinMan在评论中提到的那样,你必须理解语言(语法)和逻辑(语义)之间的区别。 例如,假设有人要求您编写一个打印数字1,000的程序。 你可能会这样写: puts 1000 但你也可以写下这些: puts 1_000 puts 0b1111101000 puts 01750 这些都是一样的。 不像它们产生相同的结果那样“相同”,但与Ruby中的“相同”解析并执行它们的方式完全相同。 它们的语法是不同的,但它们的语义是相同的。 Ruby的不同数组语法(以及它的等效字符串语法,Regexp文字等 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)