How to store <TR> id value in array, when I toggle?
<p>I am toggling <code>'tr.subCategory1'</code>and its siblings <code>.RegText</code>. at the same time I am trying to store its ids in the array like this <code>list_Visible_Ids[$(this).attr('id')] = $(this).css('display') != 'none' ? 1 : null;</code> (When I collapsed I need store <code>'null'</code> in array at its id place, If I expand I need store I need store <code>1</code> at its id place). But everytime <code>alert($(this).css('display'))</code> showing <code>block</code>. How can I handle this?. So When I collapsed or expanded it is storing <code>1</code> only.</p>

<pre><code>$(document).ready(function() {

       $('tr[@class^=RegText]').hide().children('td');

        list_Visible_Ids = [];
        var idsString, idsArray;

        idsString = $('#myVisibleRows').val();
        idsArray = idsString.split(',');

        $.each(idsArray, function() {
            if (this != "" || this != null) {
                $('#' + this).siblings('.RegText').toggle();
                list_Visible_Ids[this] = 1;
            }
        });
        $('tr.subCategory1')
        .css("cursor", "pointer")
        .attr("title", "Click to expand/collapse")
        .click(function() {
             $(this).siblings('.RegText').toggle();
             $(this).siblings('.VolumeRegText').toggle();
             //alert($(this).css('display'))
            list_Visible_Ids[$(this).attr('id')] = $(this).css('display') != 'none' ? 1 : null;

        });

        $('#form1').submit(function() {

            idsString = '';
            for (var index in list_Visible_Ids) {
                idsString += (idsString != '' ? ',' : '') + index;
            }

            $('#myVisibleRows').val(idsString);
            form1.submit();
        });
    });
</code></pre>

<p></p>
