首页 \ 问答 \ ng-grid过滤始终过滤所有行(ng-grid filtering always filters all rows)

ng-grid过滤始终过滤所有行(ng-grid filtering always filters all rows)

有一次,这是有效的,但似乎已经停止了,我为此感到头疼。 我正在使用Angular 1.2.8,使用ng-grid 2.0.7。 我正在定义我的网格选项,如下所示:

$scope.gridOptions = {
    columnDefs: [
        { field: 'ExternalCustomerId', displayName: 'Customer Id' },
        { field: 'CustomerName', displayName: 'Customer Name' },
        { field: 'ExternalUserId', displayName: 'Customer User Id' },
        { field: 'CustomerUserName', displayName: 'Customer User Name' },
        { field: 'EventName', displayName: 'Event' },
        { field: 'CreatedOn', displayName: 'Date', cellFilter: "date:'yyyy-MM-dd HH:mm:ss'" }
    ],
    plugins: [
        new ngGridCsvExportPlugin(),
        new ngGridWYSIWYGPlugin()
    ],
    data: 'customerUserEvents',
    enableColumnResize: true,
    enableRowSelection: false,
    enableCellSelection: true,
    showFooter: true,
    showFilter: true,
    filterOptions: { filterText: '', useExternalFilter: false }
};

并且数据正确显示:

ng-grid显示正确

但是,只要在“过滤器”字段中输入任何值,整个网格就会变为空白:

空白网格

到目前为止,控制台日志或其他任何地方都没有报告错误。 发生在多个浏览器上。 如果我将常规文本框绑定到$scope.gridOptions.filterOptions.filterText ,或者为$scope.gridOptions.filterOptions.filterText指定初始值, $scope.gridOptions.filterOptions.filterText发生同样的情况。

有什么建议么?


At one point, this was working, but it seems to have stopped, and I'm scratching my head as to why. I'm using Angular 1.2.8, with ng-grid 2.0.7. I'm defining my grid options like so:

$scope.gridOptions = {
    columnDefs: [
        { field: 'ExternalCustomerId', displayName: 'Customer Id' },
        { field: 'CustomerName', displayName: 'Customer Name' },
        { field: 'ExternalUserId', displayName: 'Customer User Id' },
        { field: 'CustomerUserName', displayName: 'Customer User Name' },
        { field: 'EventName', displayName: 'Event' },
        { field: 'CreatedOn', displayName: 'Date', cellFilter: "date:'yyyy-MM-dd HH:mm:ss'" }
    ],
    plugins: [
        new ngGridCsvExportPlugin(),
        new ngGridWYSIWYGPlugin()
    ],
    data: 'customerUserEvents',
    enableColumnResize: true,
    enableRowSelection: false,
    enableCellSelection: true,
    showFooter: true,
    showFilter: true,
    filterOptions: { filterText: '', useExternalFilter: false }
};

And the data is showing up correctly:

ng-grid showing correctly

However, as soon as I enter any value in the "filter" field, the entire grid goes blank:

blank ng-grid

No errors are reported in the console log or anywhere else so far as I can see. Happens across multiple browsers. The same thing happens if I bind a regular textbox to the $scope.gridOptions.filterOptions.filterText, or if I specify an initial value for $scope.gridOptions.filterOptions.filterText.

Any suggestions?


原文:https://stackoverflow.com/questions/21102954
更新时间:2022-10-25 07:10

最满意答案

据此,从版本68开始,当请求更新服务工作者脚本时,chrome将忽略HTTP缓存。 对importScripts的请求仍将通过HTTP缓存进行。 但这只是默认值 - 一个新的注册选项,updateViaCache可用于控制此行为。

updateViaCache选项的示例:

if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/service-worker.js', { updateViaCache: 'none' }); }

当设置为'none'时,在请求顶级/service-worker.js或任何导入的脚本(例如假设的路径/ to / import.js)时,不会查询HTTP缓存。


According to this, starting in version 68, chrome will ignore HTTP cache when requesting updates to the service worker script. Requests for importScripts will still go via the HTTP cache. But this is just the default—a new registration option, updateViaCache is available that offers control over this behavior.

Example of updateViaCache option:

if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/service-worker.js', { updateViaCache: 'none' }); }

When set to 'none', the HTTP cache will not be consulted when making requests for either the top-level /service-worker.js or for any imported scripted, such as the hypothetical path/to/import.js.

相关问答

更多
  • 这肯定是可能的(至少对于N小于23的大小),但我能想到的唯一方法(禁止宏等)是一种混乱。 首先,我们需要一个类型类来帮助我们将大小的集合转换为HList : import shapeless._, Nat._0 import scala.collection.generic.IsTraversableLike trait SizedToHList[R, N <: Nat] extends DepFn1[Sized[R, N]] { type Out <: HList } object SizedTo ...
  • 我使用并行工作人员进行了各种不同类型的计算,得出的结论是我的问题是与读取和写入HDD的延迟有关。 工作人员正在互相争斗谁在做什么迭代,所以他们认为所有的迭代都完成了,因为这个。 硬盘驱动器是网络驱动器,有时会有点奇怪。 它不应该但它确实如此。 有很多不同的旅行箱,我可以做到这一点。 我选择的方法是为每个工人设置一个时间延迟,具体取决于它是哪个工人。 为了确保第一批模拟没有冲突,我在每个工人之间延迟了2秒。 我现在已经完成了几次完整的模拟,并且完美地工作。 我已经使用了32名工人,等待大约1分钟,然后所有工人 ...
  • TPL是.NET框架的受欢迎的补充。 它使您的线程代码更易于使用并且更易读。 它允许您使Windows服务(或任何其他线程代码)多线程,而无需实例化和处理线程池和单个线程。 我在我的Windows服务中使用TPL,它对我很有用,我肯定会建议在大多数情况下使用TPL而不是经典的线程池。 话虽如此,有一些非常罕见的情况,您仍然希望自己处理线程池,但根据您的代码片段,您似乎并不需要为此烦恼... TPL is more than welcome addition to the .NET framework. It ...
  • 您的代码中可能存在错误。 尝试使用手动运行它 celery worker -A appname 如果它抛出错误,那么你知道它的错误。 There's probably an error in your code. Try running it manually using celery worker -A appname If it throws an error, then you know that's whats wrong with it.
  • 据此,从版本68开始,当请求更新服务工作者脚本时,chrome将忽略HTTP缓存。 对importScripts的请求仍将通过HTTP缓存进行。 但这只是默认值 - 一个新的注册选项,updateViaCache可用于控制此行为。 updateViaCache选项的示例: if ('serviceWorker' in navigator) { navigator.serviceWorker.register('/service-worker.js', { updateViaCache: 'none' }); ...
  • 这是我可能会做的: def worker(url, urls): print(multiprocessing.current_process().name + "." + str(multiprocessing.current_process().pid) + " loading " + url) returned_urls = phantomjs(url) print(multiprocessing.current_process().name + "." + str(multip ...
  • [编辑]你看到的问题是因为这段代码: self.results = self.results.append(...) 这不是原子的。 因此,在某些情况下,线程将在读取self.results (或附加)之后被中断,但在它可以将新帧分配给self.results - >此实例将丢失。 正确的解决方案是等待使用结果对象获取结果,然后将所有结果附加到主线程中。 [EDIT] The issue which you're seeing is because of this code: self.results = ...
  • 看到: 我可以从绝对URL加载Web worker脚本吗? See: Can I load a web worker script from an absolute URL?
  • 存在许多差异,但从您的角度来看,最重要的可能是import使您可以更好地控制utils.py定义的对象所在的命名空间。 import一些变体: import utils utils.f1() utils是唯一添加到工作空间的符号---基本工作空间中任何预先存在的f1都不会被覆盖,如果没有,则自身的f1()将无法识别。 对于我打算维护的代码,我更喜欢这种导入方式,因为它使我很容易在源文件中搜索它依赖于utils所有位置。 但是如果每次说的utils.f1()都过于冗长,那么你可以这样做: from util ...
  • parfor调度程序尝试对循环进行负载平衡,其中迭代不会花费相同的时间。 不幸的是,正如您所观察到的,这可能导致工作人员在循环结束时变得闲置。 有了parfor ,你无法控制工作分工; 但你可以使用parfeval将你的工作分成均匀的块 - 这可能会让你更好地利用。 或者,您甚至可以将spmd与for-drange循环结合使用。 The parfor scheduler attempts to load-balance for loops where the iterations do not take a ...

相关文章

更多

最新问答

更多
  • 您如何使用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)