Hi there,
in my project i use a navigation bar for filtereing the grid-content by the name of a habour. I try to hide the column with the harbour-names when a harbour is selected und unhide it when "all" is chosen:
function showHabour(hafen){
if(hafen == "Alle"){ $("#MyGrid").igGridFiltering('filter', ([ { fieldName: "Harbor", expr: hafen, cond: "doesNotEqual"} ])); $("#MyGrid").igGridHiding([{ columnKey: "Harbor", hidden: false }]); } else{ $("#MyGrid").igGridFiltering('filter', ([ { fieldName: "Harbor", expr: hafen, cond: "contains"} ])); $("#MyGrid").igGridHiding([{ columnKey: "Harbor", hidden: true }]); }
}
unfortunately this does not work...
can anybody help me whith this?
Best Andy
sorry, some parts of my code seeme to be hidden in the window above:
if(hafen == "Alle"){ $("#MyGrid").igGridFiltering('filter', ([{ fieldName: "Harbor", expr: hafen, cond: "doesNotEqual"}])); $("#MyGrid").igGridHiding([{ columnKey: "Harbor", hidden: false }]); } else
{ $("#MyGrid").igGridFiltering('filter', ([{ fieldName: "Harbor", expr: hafen, cond: "contains"}])); $("#MyGrid").igGridHiding([{ columnKey: "Harbor", hidden: true }]); }
Hello Andreas,
To hide/show a column there are igGridHiding functions - hideColumn and showColumn. For example:
if(hafen == "Alle") { $("#MyGrid").igGridFiltering("filter", [{ fieldname: "Harbor", expr: hafen, cond: "doesNotEqual" }]); $("#MyGrid").igGridHiding("showColumn", "Harbor");} else { $("#MyGrid").igGridFiltering("filter", [{ fieldname: "Harbor", expr: hafen, cond: "contains" }]); $("#MyGrid").igGridHiding("hideColumn", "Harbor");
Please feel free to contact me if you have further questions.
Regards,Ivaylo HubenovEntry-level developer