English 中文(简体)
jQuery - want to hide row from rich:dataTable
原标题:

I have a rich:dataTable. I want to hide a row with this code:

<c:if test="#{not empty documents &amp;&amp; documents.size!=0}">
    <rich:jQuery selector="#_inboxTable_ tr"
        query="ready(function() {
            jQuery.noConflict();
            if ( jQuery(this).find( checkboxStatus ).attr( checked , true)) {
                new Effect.Fade(jQuery(this));
            }
        })"
    />
</c:if>

The problem is that i receive: element.getInlineOpacity is not a function error....

I was initially supposing that I cannot hide a row with this Fade effect but I have made a simple other table and all was working ok...

Can you give me a clue on this issue?

最佳回答
element.getInlineOpacity is not a function

I ve never seen this before, so I Googled a bit. And what turns out? It look like that you re (at least, under the hood) mixing jQuery with Prototype or Scriptaculous and that the whole thing is colliding with each other.

Cleanup it and retry.

Edit as others already pointed out, you need to replace the non-jQuery thing new Effect.Fade() by the jQuery fadeOut() function.

问题回答

Effect.fade isn t jquery code which is probably causing you problems. Especially since you are passing it a jquery object. You could try passing it the raw DOM element instead e.g.

if ( jQuery(this).find( checkboxStatus ).attr( checked , true)) {
    new Effect.Fade(this);
}

Then again, I m not sure exactly what this whole rich table thing is... Or exactly what you are trying to do... Do you want to fade out any table row with a checked checkbox in it? What is checkboxStatus? Is it a class (in which case there should be a . in the above code)?

Depending what you are trying to do, something like this might be a more jQuery approach:

jQuery(this).find( .checkboxStatus:checked ).parent( tr ).fadeOut();




相关问题
JSF a4j:support with h:selectManyCheckbox

I m having trouble with a JSF selectManyCheckbox and A4J support. The purpose is to run some action when a checkbox is selected. This works perfectly in Firefox. Yet, when testing in any IE (ie6 / ie7 ...

Mojarra for JSF Encoding

Can anyone teach me how to use mojarra to encode my JSF files. I downloaded mojarra and expected some kind of jar but what i had downloaded was a folder of files i don t know what to do with

如何拦截要求终止?

在共同基金中,如果用户要求终止,就需要采取一些行动。 我需要某种拦截器,但我不知道如何这样做。 我需要帮助。 增 编

ICEFaces inputFile getting the file content without upload

Is there any way of just getting the content of the browsed file without any upload/file transfer operations? I currently use ICEFaces inputFile component but I do not need the default uploading ...

Weird behaviour of h:commandLink action (MethodExpression)

I have two JSPs where I am displaying some info from database in a h:dataTable. One of them is showing all the info, and one of them user specifically. I have showXML.jsp that shows the "XML" column ...

How to correctly use ResultSet with h:dataTable

The problem is, that after displaying the ResultSet with <h:dataTable>, the connection is left open. If I close it, it closes the ResultSet too. I m thinking about copying the ResultSet data ...

热门标签