Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
基于struts对象的属性更改jquery中的表(tablesorter)行颜色_Jquery_Struts_Tablesorter - Fatal编程技术网

基于struts对象的属性更改jquery中的表(tablesorter)行颜色

基于struts对象的属性更改jquery中的表(tablesorter)行颜色,jquery,struts,tablesorter,Jquery,Struts,Tablesorter,我不熟悉jquery。 需要一些帮助来根据struts对象属性更改行颜色,这有助于迭代和构造表行。我猜bgcolor/fgcolor属性被jquery覆盖了 <%@ taglib prefix="s" uri="/struts-tags"%> <link rel="stylesheet" type="text/css" href="themes/blue/style.css"> <link rel="stylesheet"

我不熟悉jquery。 需要一些帮助来根据struts对象属性更改行颜色,这有助于迭代和构造表行。我猜bgcolor/fgcolor属性被jquery覆盖了

<%@ taglib prefix="s" uri="/struts-tags"%>                      
<link rel="stylesheet" type="text/css" href="themes/blue/style.css">
<link rel="stylesheet" href="js/themes/base/jquery.ui.all.css">
<script type="text/javascript" src="js/jquery-latest.js"></script>
<script type="text/javascript" src="js/jquery.ui.core.js"></script>
<script type="text/javascript" src="js/jquery.ui.widget.js"></script>
<script type="text/javascript" src="js/jquery.ui.datepicker.js"></script>
<script type="text/javascript"
    src="js/jquery.tablesorter_modified4search.js"></script>
<script type="text/javascript" src="js/tablesorter_filter.js"></script>
<script type="text/javascript" src="js/jquery.jeditable.mini.js"></script>
<script type="text/javascript" src="js/jquery.jeditable.datepicker.js"></script>
<script type="text/javascript" src="js/autogrow.js"></script>
<script type="text/javascript" src="js/jquery.jeditable.autogrow.js"></script>

        <table id="myTable" class="tablesorter">
        <thead>
            <!--- header goes here -->
        <thead>
        <tbody>
        <s:iterator value="reghistory" id="reghistory">

              <s:if test="%{#reghistory.deadind.toString()=='Y'}">  
                <tr bgcolor="red">                    
              </s:if>
              <s:else>
                <tr fgcolor="blue">                   
              </s:else>                 
              <s:if test='%{#reghistory.reasoncde.toString()=="RS"}'>
                    <td onmouseover="this.disabled=true;"><b
                    class="editSelectable"
                    id='<s:property value="#reghistory.regname"/>;<s:date name="#reghistory.fromdt" format="yyyy-MM-dd"/>;<s:date name="#reghistory.actiondt" format="yyyy-MM-dd"/>;<s:property value="#reghistory.reasoncde"/>;reasoncde'
                    style="display: inline">Resolved</b></td>
              </s:if>
              <s:else>                    
                    <td onmouseover="this.disabled=true;"><b
                    class="editSelectable"
                    id='<s:property value="#reghistory.regname"/>;<s:date name="#reghistory.fromdt" format="yyyy-MM-dd"/>;<s:date name="#reghistory.actiondt" format="yyyy-MM-dd"/>;<s:property value="#reghistory.reasoncde"/>;reasoncde'
                    style="display: inline">Active</b><img src="img/icons/dead_ind.GIF"  height="14" width="14" title="Dead Indicator"> </td>
              </s:else>

                    <td onmouseover="this.disabled=true;"
                    id='<s:property value="#reghistory.regname"/>;<s:date name="#reghistory.fromdt" format="yyyy-MM-dd"/>;<s:date name="#reghistory.actiondt" format="yyyy-MM-dd"/>;<s:property value="#reghistory.reasoncde"/>;createddt'><s:date
                        name="#reghistory.createddt" format="dd/MM/yyyy HH:mm" /></td>
                    <td><s:property value="#reghistoryNew.user" /></td>                       

                </tr>
        </s:iterator>
        </tbody>
        </table>
        <script type="text/javascript" id="js">
            $(document).ready(function() {

                $("#historyTable").tablesorter({
                    stripingRowClass : [ 'even', 'odd' ],

                });
                $("#myTable").tablesorter({
                    stripingRowClass : [ 'even', 'odd' ],

                });
        </script>

断然的
忙碌的
$(文档).ready(函数(){
$(“#历史表格”).tablesorter({
stripingRowClass:[“偶数”、“奇数”],
});
$(“#myTable”).tablesorter({
stripingRowClass:[“偶数”、“奇数”],
});

tablesorter的可能重复项没有向行中添加任何类名,因为您需要启用zebra小部件:
$(“table”).tablesorter({widgets:[“zebra”]});
这在上面的代码中没有完成。