I would like to hide an iggrid column on dropdownlist selection using Jquery. I tried the following but didn't work.
var hideTheColumn = $("#cntStatusID").val(); $("#lifeInsuranceGrid").delegate("iggridhidingcolumnhiding", function (evt, ui) { if (hideTheColumn == 3) { $("#lifeInsuranceGrid").igGridHiding("showColumn", columnsGrid); } else { $("#lifeInsuranceGrid").igGridHiding("hideColumn", columnsGrid); } });
and the definition of my grid is :
... columns: [{ headerText: headerTextValues[0], key: "insuranceID", hidden: true }, { headerText: headerTextValues[1], key: "amount", width: 175, template: "<a href='Home/ManageLifeInsuranceEditor?liId=${insuranceID}&command=edit' class='editLifeDialog'>${amount}</a>" }, { headerText: headerTextValues[2], key: "Benefname", width: 200, template: "<a href='Home/ManageLifeInsuranceEditor?liId=${insuranceID}&command=edit' class='editLifeDialog'>${Benefname}</a>" }, { headerText: headerTextValues[3], key: "Altername", width: 150, template: "<a href='Home/ManageLifeInsuranceEditor?liId=${insuranceID}&command=edit' class='editLifeDialog'>${Altername}</a>" }, { headerText: headerTextValues[4], key: "willMakerTypeDesc", hidden: true, width: 150, template: "<a href='Home/ManageLifeInsuranceEditor?liId=${insuranceID}&command=edit' class='editLifeDialog'>${willMakerTypeDesc}</a>" }, ],
Hello Sonia ,
Could you let me know whether the grid is on the view which you load dynamically:
$.ajax({
url: 'Home/ManageQ1',
contentType: 'application/html; charset=utf-8',
type: 'GET',
dataType: 'html'
})
If that’s the case the grid will be re-instantiated each time you change the selection from the drop down.
Could you provide some additional information on how the partial views are loaded and in what order they’re loaded?
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://ko.infragistics.com/support
Hi Maya,
Please find attached my sample.
I have two files: one for the grid (the first partial view) and the second for the dropdownlist (the second partial view)
Thank you for your help
Regards
Sonia
Sure that will be helpful.
I will prepare that and send it to you
Thanks again for your help.
Hello Sonia,
Could you share a sample that demonstrates the exact scenario in which you’re experiencing this issue?
If that’s not possible could you share the views and how they’re being rendered so that I may try and replicate the issue on my side?
I’m looking forward to your reply.
Thank you for the explanation and the example.
I applied the same example but for some reason it didn't work. It is even affecting the other "jquery" functions like button clicks...
My dropDownList is from another partial view and based on its value I would like to hide/show the column of my grid which is in another partial view as well.
This shouldn't be a problem but I don't know why I am experiencing this issue.