change collumns clicking in a button

77 views
Skip to first unread message

Deivisson

unread,
May 25, 2012, 4:59:43 PM5/25/12
to Flexigrid for jQuery
Hello

need to make a column disappear and another appear when you click a
button, because each button reloads the data from the grid according
to the status of an order, open, in attendance, closed, closed but if
I need to take the expiration date, and show the date of closure.

I tried using the function below, but all I got was hiding only the
title of the column, the rest of it still there

invoke - showColumn('#idflexgridhere', 'namecolluumnhere, true or
false here to visible);

ex showColumn('#flexigrid2', 'date', false);

in document ready:
var visible: true;

function:
function showColumn(tbl, columnName, visible) {

var grd = $(tbl).closest('.flexigrid');
var colHeader = $('th[abbr=' + columnName + ']', grd);
var colIndex = $(colHeader).attr('axis').replace(/col/, "");


// queryVisible = $(colHeader).is(':visible');
// alert(queryVisible);

$(colHeader).toggle(visible);

$('tbody tr', grd).each(
function () {
$('td:eq(' + colIndex + ')', this).toggle(visible);
}
);

}
Reply all
Reply to author
Forward
0 new messages