Show/ Hide Column dynamically
Show/ Hide Column dynamically
Hi,
I want to use the ability to hide/show column in conjunction with this piece of code .
In fact, I put all the columns of my table in a select (multiple) (columns showed) that I can transfer to an other select. (columns hidden) but I can't write the proper code from your example :
http://datatables.net/examples/api/show_hide.html
(The part code for putting columns in the proper select )
[code]
function MoveItemDeVers(de, vers)
{
var zlAv = \"zlItem\"+de+\"[]\";
var zlAp = \"zlItem\"+vers+\"[]\";
if (document.test.elements[zlAv].options.selectedIndex >= 0) {
while (document.test.elements[zlAv].options.selectedIndex >= 0) {
ind = document.test.elements[zlAv].options.selectedIndex;
texte = document.test.elements[zlAv].options[ind].text;
valeur = document.test.elements[zlAv].options[ind].value;
document.test.elements[zlAv].options[ind] = null;
var item = new Option(texte, valeur);
lg = document.test.elements[zlAp].options.length;
document.test.elements[zlAp].options[lg] = item;
}
}
else { alert(\"Aucun Item selectionne !\"); }
return(false);
}
[/code]
Thanks for your help !
I want to use the ability to hide/show column in conjunction with this piece of code .
In fact, I put all the columns of my table in a select (multiple) (columns showed) that I can transfer to an other select. (columns hidden) but I can't write the proper code from your example :
http://datatables.net/examples/api/show_hide.html
(The part code for putting columns in the proper select )
[code]
function MoveItemDeVers(de, vers)
{
var zlAv = \"zlItem\"+de+\"[]\";
var zlAp = \"zlItem\"+vers+\"[]\";
if (document.test.elements[zlAv].options.selectedIndex >= 0) {
while (document.test.elements[zlAv].options.selectedIndex >= 0) {
ind = document.test.elements[zlAv].options.selectedIndex;
texte = document.test.elements[zlAv].options[ind].text;
valeur = document.test.elements[zlAv].options[ind].value;
document.test.elements[zlAv].options[ind] = null;
var item = new Option(texte, valeur);
lg = document.test.elements[zlAp].options.length;
document.test.elements[zlAp].options[lg] = item;
}
}
else { alert(\"Aucun Item selectionne !\"); }
return(false);
}
[/code]
Thanks for your help !
This discussion has been closed.
Replies
Please anyone help :-( ??
Thanks