I got this working on partial basis.

Since displaytag column has no id .I'm using class name to get this into
DOM.It show the column . on link click...but fails when jusing checkbox ...

css:

.sym{
    display: none;
}
.sym1{
    display: none;
}
.harm{
    display: none;
}
.function123{
    display: none;
}



Javascript

<script language="JavaScript">
            function getElementsByClassName(strClass, strTag, objContElm) {
                strTag = strTag || "*";
                objContElm = objContElm || document;
                var objColl = objContElm.getElementsByTagName(strTag);
                if (!objColl.length &&  strTag == "*" &&  objContElm.all)
objColl = objContElm.all;
                var arr = new Array();
                var delim = strClass.indexOf('|') != -1  ? '|' : ' ';
                var arrClass = strClass.split(delim);
                for (var i = 0, j = objColl.length; i < j; i++) {
                    var arrObjClass = objColl[i].className.split(' ');
                    if (delim == ' ' && arrClass.length >
arrObjClass.length) continue;
                    var c = 0;
                    comparisonLoop:
                        for (var k = 0, l = arrObjClass.length; k < l; k++)
{
                        for (var m = 0, n = arrClass.length; m < n; m++) {
                            if (arrClass[m] == arrObjClass[k]) c++;
                            if ((delim == '|' && c == 1) || (delim == ' ' &&
c == arrClass.length)) {
                                arr.push(objColl[i]);
                                break comparisonLoop;
                            }
                        }
                    }
                }
                return arr;
            }
            function testing(strClass)
            {
                var myObjColl = getElementsByClassName(strClass);
                for (var i = 0, j = myObjColl.length; i < j; i++) {
                    myObjColl[i].className = myObjColl[i].className + '
commomshow';
                }
            }
            function showMe (strClass,strClass1, box) {
                var vis = (box.checked);
                var myObjColl = getElementsByClassName(strClass);
                var myObjCol2 = getElementsByClassName(strClass1);
                if(vis==true)
                {
                    for (var i = 0, j = myObjColl.length; i < j; i++) {
                        myObjColl[i].className = myObjColl[i].className +
'commomshow';
                        myObjCol2[i].className = myObjCol2[i].className +
'commomshow';
                    }
                }
                else{
                    for (var i = 0, j = myObjColl.length; i < j; i++) {
                        myObjColl[i].className = myObjColl[i].className +
'display:none';
                        myObjCol2[i].className = myObjCol2[i].className +
'display:none';
                    }
                }
            }



please someone help me with this below is the code..

<display:table id="data2" class="displaytag" name="otherData"
requestURI="/Other.action"   export="true" style="font-family: Arial;"
sort="external">
        <%--        <display:column property="clinicianid"
title="Clinician<br/>Id" sortable="true" style="font-family:
Arial;width:100px" />
                            <display:column property="clinicianname"
title="Clinician<br/>Name" sortable="true" style="font-family:
Arial;width:100px"/> --%>
        <display:column title="MRN" sortable="true" style="font-family:
Arial;width:100px"  media="html" sortProperty="clientid"><a
href="/org.kp.psychoutcomes.toolkit/graph.action?client_id=<c:out
value="${data2.clientid}"/>" target="_blank"> <c:out
value="${data2.clientid}"/> </a></display:column>

        <display:column property="symptoms" title="Symptoms" sortable="true"
maxLength="40"  media="html" class="sym" headerClass="sym"
style="font-family: Arial;width:100px" format="{0,number,0.00}"  />
        <display:column property="harm" title="Harm</br>Risk"
sortable="true" maxLength="40"   media="html" class="harm"
headerClass="harm" style="font-family: Arial;width:100px"
format="{0,number,0.00}" />
</display:table>





On Mon, Aug 24, 2009 at 6:04 PM, punuru <sadhana.pun...@gmail.com> wrote:

>
>  is there a way to hide and show column when a checkbox is clicked.
>
> I have some of the column class and header set to hidden and  now i was to
> show and hide when a checkbox is clicked.
>
> Can anybody help with any example.
>
> I tried to set visibilty to true ...but this is not working...
> --
> Thanks & Regards
>
> Sadhana  Punuru
>



-- 
Thanks & Regards

Sadhana  Punuru
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to