小编use*_*734的帖子

jQuery:强制显示修改后的dom

我遇到了一个问题,试图在我的页面上运行一个"加载微调器",该表在一个表被分类时运行,特别是对于较慢的客户端,因为对页面进行排序可能需要10秒钟.我可以看到使用微调器代码修改DOM,但是它不会显示.我希望在排序发生之前我可以做些什么来强制显示微调器,当然也可以在排序完成时停止它.

我的排序基于'sorttable.js',我已经修改它来处理表的第一列的二级排序(其中包含名称).

我的微调器使用'spin.js'.

我仍然是这个jQuery东西的新手,而且这个可排序的代码非常复杂.我突出显示了下面的部分,但我的完整修改后的可排序代码(现在)可以在'sorttable-TESTING-ONLY.js'找到, 并在'TESTING-ONLY-sort_and_spin.htm'上有一个测试html页面.

因此,脚本在页面加载时设置一些函数("......"表示跳过行):

makeSortable: function(table) {                          //line 75
  ......
  headrow = table.tHead.rows[0].cells;

  for (var i=0; i<headrow.length; i++) {                 //line 114
    .....
    headrow[i].sorttable_sortfunction = sorttable.guessType(table,i);   //line 126

    // code to start/stop spinner
    headrow[i].sorttable_spinner = (function(val) {      //line 136
      return function(val) {
        var $this = $(this),
        data = $this.data();

        if (data.spinner) {
          data.spinner.stop();
          delete data.spinner;
        }
        if (val > 0) {
          var opts = {
            .......
           };
           data.spinner = new Spinner($.extend({color: …
Run Code Online (Sandbox Code Playgroud)

javascript jquery tablesorter spin.js

9
推荐指数
1
解决办法
2340
查看次数

Powershell正则表达式:获取字符串的“不匹配”部分吗?

我对Powershell不太了解,并遇到了问题。

我有一个Powershell脚本,该脚本调用一个批处理文件,该文件将装入备份映像(shadowprotect),对装入的映像运行chkdsk,卸除映像并返回。

批处理文件处理的所有输出都返回到我的powershell脚本。我正在尝试对此进行分析,以删除chkdsk命令生成的所有“进度”行,chkdsk似乎没有任何办法抑制此输出(在大磁盘映像上,我最终可能获得数百个进度行)。

我可以创建正则表达式来捕获所有“ Progress”行并将其放到我的日志文件中,但是我无法弄清楚该语法为我提供了与正则表达式不匹配的所有内容。

我尝试解析的返回值的非常简短的示例:

Try to mount d:\backups\colt\F_VOL-b001-i453-cd.spi
Mounting image chain "D:\Backups\colt\F_VOL-b001.spf|D:\Backups\colt\F_VOL-b001-i014-cd-cw.spi|D:\Backups\colt\F_VOL-b001-i018-cd.spi|D:\Backups\colt\F_VOL-b001-i022-cd.spi|D:\Backups\colt\F_VOL-b001-i026-cd.spi|D:\Backups\colt\F_VOL-b001-i030-cd.spi|D:\Backups\colt\F_VOL-b001-i445-cd.spi|D:\Backups\colt\F_VOL-b001-i449-cd.spi|D:\Backups\colt\F_VOL-b001-i453-cd.spi"

The type of the file system is NTFS.
Volume label is Local Disk - single.

WARNING!  F parameter not specified.
Running CHKDSK in read-only mode.

Stage 1: Examining basic file system structure ...
Progress: 0 of 4320 done; Stage:  0%; Total:  0%; ETA:   0:00:14    
Progress: 0 of 4320 done; Stage:  0%; Total:  0%; ETA:   0:00:21 .  
Progress: 6 of 4320 done; Stage:  0%; Total:  0%; ETA: …
Run Code Online (Sandbox Code Playgroud)

regex powershell batch-file

0
推荐指数
1
解决办法
316
查看次数