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 } };
并且数据正确显示:
但是,只要在“过滤器”字段中输入任何值,整个网格就会变为空白:
到目前为止,控制台日志或其他任何地方都没有报告错误。 发生在多个浏览器上。 如果我将常规文本框绑定到
$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:
However, as soon as I enter any value in the "filter" field, the entire grid goes blank:
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
最满意答案
据此,从版本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.
相关问答
更多-
缺少Sized.unapply(Missing Sized.unapply)[2021-12-28]
这肯定是可能的(至少对于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 ... -
为什么Matlab中的parpool中的其他工作人员闲置?(Why do additional workers in a parpool in Matlab sit idle?)[2021-12-08]
我使用并行工作人员进行了各种不同类型的计算,得出的结论是我的问题是与读取和写入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 ...