小编gaw*_*awi的帖子

数据表jquery点击事件在分页后不起作用

我正在使用http://datatables.net/

<button class='btn btn-success activeAccount'>Activate Account</button>
Run Code Online (Sandbox Code Playgroud)

我在onclick事件上触发ajax调用,下面是ajax调用代码:

$(".activeAccount").click(function() {
  var intCounselorId = $(this).parent().parent().find('input[class="counselorId"]').attr("value");
  var intOwnerId = $(this).parent().parent().find('input[class="userID"]').attr("value");
  var strAction = 'activateAccount';
  performAction(intCounselorId, intOwnerId, strAction);
});

function performAction(intCounselorId, intOwnerId, strAction) {
  $.ajax({
      url: '/admin/counselormanagement/expertmanagementgridaction',
      data: 'intCounselorId='+intCounselorId+'&intOwnerId='+intOwnerId+'&strAction='+strAction,
      type: "POST",
      async:false,
      success: function(intFlag) {
        if(intFlag == 1){
          location.reload();
        }
      }
  });
}
Run Code Online (Sandbox Code Playgroud)

我正在尝试运行一个在第一页上正常工作的onclick事件,但是一旦我转到第2页(或任何其他),它就会停止工作.

我正在使用jquery-1.10.2.min.js和1.9.4版本的datatable

javascript ajax datatable jquery

22
推荐指数
1
解决办法
2万
查看次数

npm package.json OS特定脚本

我想创建一个package.json构建脚本,在从Windows,Linux,Mac运行时执行稍微不同的命令集.

问题是我无法找到一种方法将它放在package.json文件中,在每个系统上运行都没有问题.

这是我想要的一个例子:

"scripts" : {
    "build.windows" : "echo do windows specific stuff",
    "build.linux" : "echo do linux specific stuff",
    "build.mac" : "echo do mac specific stuff",
    "build" : "??????????????" <- what to put here to execute script designed for OS
                                  on which npm is running
}
Run Code Online (Sandbox Code Playgroud)

node.js npm package.json npm-scripts

12
推荐指数
2
解决办法
6753
查看次数

可编辑DataTable中的SelectBooleanCheckbox不会更改

我有一个可编辑的dataTable(editMode = "cell").

编辑自由文本字段和列表框非常简单.但是,我无法弄清楚如何编辑复选框字段.更具体的是,当我尝试编辑复选框选择时,输出构面中的数据在更改后未实现.

<p:dataTable id="submodels" var="submodel" value="#{projectMB.submodels}" 
             editable="true" editMode="cell" widgetVar="cellSubmodels">
  <p:column headerText="Mapping file">
    <p:cellEditor>
      <f:facet name="output">
        <h:selectBooleanCheckbox value="#{submodel.mapping}" onclick="return false;"
           style="width:96%" label="Root model" readonly="true"/>
      </f:facet>
      <f:facet name="input">
        <h:selectBooleanCheckbox value="#{submodel.mapping}" style="width:96%" 
           label="Root model"/>
      </f:facet>
    </p:cellEditor>
  </p:column>
</p:dataTable>
Run Code Online (Sandbox Code Playgroud)

有点令人惊讶,当我将输入facet更改为inputText(并在其中输入true/false值)时,复选框正确更新:

<p:dataTable id="submodels" var="submodel" value="#{projectMB.submodels}" 
             editable="true" editMode="cell" widgetVar="cellSubmodels">
  <p:column headerText="Mapping file">
    <p:cellEditor>
      <f:facet name="output">
        <h:selectBooleanCheckbox value="#{submodel.mapping}" onclick="return false;"
           style="width:96%" label="Root model" readonly="true"/>
      </f:facet>
      <f:facet name="input">
        <p:inputText value="#{submodel.mapping}" style="width:96%" />
      </f:facet> 
    </p:cellEditor>
  </p:column>
</p:dataTable>
Run Code Online (Sandbox Code Playgroud)

你能指出我做错了什么吗?我在javascript控制台和Java服务器端没有错误.

我正在使用Primefaces 4.0版

datatable tablecelleditor primefaces jsf-2 selectbooleancheckbox

7
推荐指数
1
解决办法
5917
查看次数

jQuery UI焦点问题

我正在接受问题

无法获取未定义或空引用的属性'_focusTabbable'

我正在使用Jquery-ui-1.10.2.custom.js

我在这里遇到问题

if ( !$.ui.dialog.overlayInstances ) {
    // Prevent use of anchors and inputs.
    // We use a delay in case the overlay is created from an
    // event that we're going to be cancelling. (#2804)
    this._delay(function() {
        // Handle .dialog().dialog("close") (#4065)
        if ( $.ui.dialog.overlayInstances ) {
            this.document.bind( "focusin.dialog", function( event ) {
                if ( !that._allowInteraction( event ) ) {
                    event.preventDefault();
                    **$(".ui-dialog:visible:last .ui-dialog-content")
                        .data( widgetFullName )._focusTabbable();**
                }
            });
        }
    });
}
Run Code Online (Sandbox Code Playgroud)

jquery-ui

6
推荐指数
1
解决办法
5042
查看次数

java.lang.LinkageError:加载程序“bootstrap”尝试使用 Java11 和 Jacoco 0.8.5 为 java.lang.$JaCoCo 重复类定义

在 Jenkins 中运行测试项目时出现以下错误

Caused by: java.lang.LinkageError: loader 'bootstrap' attempted duplicate class definition for java.lang.$JaCoCo. (java.lang.$JaCoCo is in module java.base of loader 'bootstrap')

Jacoco 在父 pom 和当前测试 pom 中定义,具有不同的目标。

父pom.xml

<build>
  <plugins>
    <plugin>
      <groupId>org.jacoco</groupId>
      <artifactId>jacoco-maven-plugin</artifactId>
      <version>0.8.5</version>
      <dependencies>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>4.13</version>
        </dependency>
      </dependencies>
      <executions>
        <execution>
          <id>validate-headless</id>
          <phase>validate</phase>
          <goals>
            <goal>prepare-agent</goal>
          </goals>
          <configuration>
            <skip>true</skip>
            <propertyName>failsafe.argLine</propertyName>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>
Run Code Online (Sandbox Code Playgroud)

测试项目-pom.xml

<properties>
  <maven.repo.local>${user.home}/.m2/repository</maven.repo.local>
  <itCoverageAgent>-javaagent:${maven.repo.local}/org/jacoco/org.jacoco.agent/0.8.5/org.jacoco.agent-0.8.5-runtime.jar=destfile=${basedir}/target/jacoco-it.exec</itCoverageAgent>
</properties>

<build>
  <plugins>
    <plugin>
      <artifactId>maven-failsafe-plugin</artifactId>
      <configuration>
        <argLine>${failsafe.argLine} ${itCoverageAgent}</argLine>
        <testFailureIgnore>true</testFailureIgnore>
        <reuseForks>true</reuseForks>
      </configuration>
    </plugin>
  </plugins>
</build>

<profiles>
  <profile>
    <id>coverage</id>
    <build> …
Run Code Online (Sandbox Code Playgroud)

java maven jacoco java-11 jacoco-plugin

6
推荐指数
1
解决办法
4194
查看次数

如何在 primefaces 中创建具有百分比高度的对话框

我想p:dialog在 primefaces 中创建一个组件,其大小以百分比给出:

<p:dialog header="Dialog" widgetVar="dlg" width="70%" height="70%">
  Some content
</p:dialog>
Run Code Online (Sandbox Code Playgroud)

上面的代码创建了一个具有正确宽度值的组件。然而,对话框的高度被设置为某个非常小的值(绝对不是 70%)。

我的问题是:如何设置对话框的百分比高度?

我做了一些研究,发现在 primefaces 代码中,height值被明确设置为“auto”,并且 height 属性被分配给 content div。这解释了为什么我的代码不起作用,但是我能做些什么来克服这个问题呢?

primefaces jsf-2

5
推荐指数
1
解决办法
2万
查看次数

如何增加官方postgreSQL 10.0 docker镜像中的max_connection

问题

我使用默认的docker postgresql配置打开了太多连接

目标

我想扩展max_connection而不使用卷来安装配置(我需要在我的CI环境中默认使用它).

我试图用来sed编辑配置,但这没有任何效果.

覆盖postgresql docker官方映像的默认配置的推荐方法是什么?

postgresql sed docker

5
推荐指数
3
解决办法
5393
查看次数

如何在 Visual Studio Code 中运行 SML REPL

我正在尝试在 Visual Studio Code 编辑器中使用 SML/NJ,但无法弄清楚如何在 Visual Studio Code 中运行 SML REPL。我已在 Visual Studio Code 中安装了 SML 扩展,但没有可用的文档。如何在 Visual Studio Code 中配置 SML?

sml visual-studio-code

5
推荐指数
1
解决办法
3456
查看次数

如何为每行添加行ID?

我正在尝试使用jquery数据表向tr添加行ID.我甚至尝试了http://datatables.net/release-datatables/examples/server_side/ids.html这个例子, 但似乎没有用,我使用了相同的JSON文件.

任何帮助将不胜感激.

它应该给出类似的东西

<tr id="row_7">
  <td>Emkay Entertainments</td>
  <td>Nobel House, Regent Centre</td>
  <td>Lothian</td>
</tr>
<tr id="row_8">
  <td>The Empire</td>
  <td>Milton Keynes Leisure Plaza</td>
  <td>Buckinghamshire</td>
</tr>
Run Code Online (Sandbox Code Playgroud)

>更新了代码

<script type="text/javascript" charset="utf-8">
  $(document).ready(function () {
    var oTable = $('#example').dataTable(
      /** column structure and ppoluating columns **/ {
      "aoColumnDefs": [{
          "aTargets": [0],
          //"mData": "download_link",
          "mRender": function (data, type, full) {}
        }, {
          "aTargets": [1],
          //"mData": "download_link",
        }, {
          "aTargets": [2],
          //"mData": "download_link",
        }, {
          "aTargets": [3],
          //"mData": "download_link",
        }, {
          "aTargets": [4],
          //"mData": …
Run Code Online (Sandbox Code Playgroud)

javascript jquery datatables

4
推荐指数
1
解决办法
7451
查看次数

PrimeFaces gmap组件中的fitBounds

有没有办法在PrimeFaces gmap组件创建的谷歌地图对象中调用fitBounds方法?我尝试了下面的代码,但得到javascript错误:.它看起来被PrimeFaces框架的布尔属性覆盖.TypeError: primefacesMap.fitBounds is not a functionfitBounds

<h:head>
  <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"/>
  <script type="text/javascript">
//<![CDATA[
  function initPrimefacesComponent(){
    var primefacesMap = gmtls.getMap();
    var bounds = new google.maps.LatLngBounds();
    var points = [
      new google.maps.LatLng(41.3, 2),
      new google.maps.LatLng(41.309, 2)
      ];
    // Extend bounds with each point
    for (var i = 0; i < points.length; i++) {
      bounds.extend(points[i]);
      new google.maps.Marker({position: points[i], map: primefacesMap});
    }
    // Apply fitBounds
    primefacesMap.fitBounds(bounds); 
  }
//]]>
  </script>
</h:head>

<h:body onload="initPrimefacesComponent();" >
  <p:gmap center="41.3, 2" zoom="15" type="ROADMAP" …
Run Code Online (Sandbox Code Playgroud)

javascript google-maps-api-3 primefaces

2
推荐指数
1
解决办法
1665
查看次数

如何使用Mockito验证方法是否在另一种方法中调用?

我有一个带有publish()方法的A类.在该方法中将调用另一个方法并将类A对象作为参数传递给类B.

public class A {
    public void publish() {
      ClassB classb = new ClassB();
      classb.sendRequest(this)
    }
}
Run Code Online (Sandbox Code Playgroud)

问题是如何使用Mockito来验证sendRequest调用publish()方法时调用方法?我是Mockito的新手.

java junit unit-testing mockito

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