我试图在我的一个数据表(XPages)中实现一个tablesorter.所以我有地址jquery-1.11.1.js和jquery.tablesorter.min.js
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.resources>
<xp:script src="/jquery-1.11.1.js" clientSide="true"></xp:script>
<xp:script src="/jquery.tablesorter.min.js" clientSide="true"></xp:script>
</xp:this.resources>
<xp:scriptBlock>
<xp:this.value><![CDATA[
$(document).ready(function()
{
$("#dataTable1").tablesorter();
}
);
]]></xp:this.value>
</xp:scriptBlock>
<xp:dataTable id="dataTable1" rows="30" styleClass="tablesorter">
<xp:column id="column1">
<xp:text escape="true" id="computedFieldName"><xp:this.value>
<![CDATA[# {javascript:testArray[0]}]]></xp:this.value></xp:text>
<xp:this.facets>
<xp:label value="Name" id="label1" xp:key="header"></xp:label></xp:this.facets>
</xp:column>
<xp:column id="column2">
<xp:text escape="true" id="computedFieldAdress"><xp:this.value><![CDATA[#
{javascript:testArray[1]}]]></xp:this.value></xp:text>
<xp:this.facets>
<xp:label value="Adress" id="label2" xp:key="header"></xp:label></xp:this.facets>
</xp:column>
</xp:dataTable>
</xp:view>
Run Code Online (Sandbox Code Playgroud)
你能告诉我,为什么它不起作用?
问候
我试图用Bootstrap验证器(http://bootstrapvalidator.com/examples/mask/)构建一个Xpage 来验证IP地址
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" id="testid">
<xp:this.resources>
<xp:styleSheet href="/bootstrap.css"></xp:styleSheet>
<xp:styleSheet href="/bootstrapValidator.min.css"></xp:styleSheet>
<xp:script src="/jquery-1.11.1.js" clientSide="true"></xp:script>
<xp:script src="/bootstrap.min.js" clientSide="true"></xp:script>
<xp:script src="/bootstrapValidator.js" clientSide="true"></xp:script>
<xp:script src="/jquery.mask.min.js" clientSide="true"></xp:script>
</xp:this.resources>
<xp:form id="maskForm">
<div class="col-lg-5">
<xp:inputText id="ipAddress" title="ipAddress">
</xp:inputText>
</div>
</xp:form>
<xp:scriptBlock>
<xp:this.value><![CDATA[
var test = '#{javascript:getClientId("maskForm")}';
XSP.addOnLoad( function() {
$("#"+test)
.bootstrapValidator({
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
ipAddress: {
validators: {
ip: {
message: 'The IP address is not valid'
}
}
}
} …
Run Code Online (Sandbox Code Playgroud)