javascriptjqueryinfragisticsignite-uiiggrid

Infragistics - show/hide columns in code (not using default column chooser dialog)


I have implemented custom column chooser dialog. When user submit changes I have two arrays:

keysOfColumnsToShow (example: ['key1', 'key2', ...])
keysOfColumnsToHide (example: ['key3', 'key4', ...])

I have debugged and keys are fine. Now I try to apply changes in code. To do this I use igGridHiding method:

$(".grid").igGridHiding("showMultiColumns", keysOfColumnsToShow)
$(".grid").igGridHiding("hideMultiColumns", keysOfColumnsToHide)

The problem is that after calling igGridHiding method, some headers are not above corrent column and some headers are empty.

What is the corrent way to manage hiding/showing columns in code without using default dialog?


Solution

  • Can you give more details on your scenario? I investigated this and prepared a sample, but didn't manage to replicate the scenario you are describing.

    It's working as expected. Can you modify the following code sample to demonstrate it?

    <!DOCTYPE html>
    <html>
    <head>
    	<title></title>
    
    	<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.js"></script>
    	<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.js"></script>
    
    	<script type="text/javascript" src="http://cdn-na.infragistics.com/igniteui/2017.1/latest/js/infragistics.loader.js"></script>
    	
    	<style type="text/css">
    		body {
    			font-size: 0.75em; 
    		}
    	</style>
    
    	<script type="text/javascript">
    		var sourceData = { 
    			"Products": [
    				{ "ProductID": 1, "UnitsInStock": 989, "ProductDescription": "hhiivm", "UnitPrice": 661.3712164859154, "DateAdded": "2006-12-25T17:29:46.108" }, { "ProductID": 2, "UnitsInStock": 853, "ProductDescription": "v", "UnitPrice": 351.86312736564463, "DateAdded": "1997-06-18T07:28:54.737" }, { "ProductID": 3, "UnitsInStock": 226, "ProductDescription": "hwn", "UnitPrice": 322.57021792352674, "DateAdded": "2008-03-22T23:57:11.966" }, { "ProductID": 4, "UnitsInStock": 480, "ProductDescription": " os", "UnitPrice": 758.28264968389772, "DateAdded": "1998-04-10T02:06:32.486" }, { "ProductID": 5, "UnitsInStock": 290, "ProductDescription": "yaxrhvufbsj ", "UnitPrice": 245.75594870641641, "DateAdded": "1998-06-08T18:12:46.175" }, { "ProductID": 6, "UnitsInStock": 882, "ProductDescription": "jgggiuanb", "UnitPrice": 952.47738526783769, "DateAdded": "1996-08-13T02:18:57.885" }, { "ProductID": 7, "UnitsInStock": 277, "ProductDescription": "obgiuvxwpu", "UnitPrice": 365.10401748358458, "DateAdded": "2000-12-10T18:15:56.766" }, { "ProductID": 8, "UnitsInStock": 56, "ProductDescription": "uwvfycvhlx", "UnitPrice": 989.65917108098938, "DateAdded": "2004-04-17T05:46:07.239" }, { "ProductID": 9, "UnitsInStock": 143, "ProductDescription": "joismllpcpki", "UnitPrice": 928.07773916426936, "DateAdded": "2006-12-28T05:11:23.373" }, { "ProductID": 10, "UnitsInStock": 790, "ProductDescription": "wwh fp", "UnitPrice": 228.61830295464878, "DateAdded": "2005-10-12T07:35:48.515" }, { "ProductID": 11, "UnitsInStock": 121, "ProductDescription": "wg", "UnitPrice": 633.54554755312654, "DateAdded": "2000-05-13T16:08:09.876" }, { "ProductID": 12, "UnitsInStock": 382, "ProductDescription": "rym", "UnitPrice": 17.810668338933336, "DateAdded": "2001-12-20T01:24:35.454" }, { "ProductID": 13, "UnitsInStock": 613, "ProductDescription": "nidtftpeam ", "UnitPrice": 21.315432163567948, "DateAdded": "1996-04-15T19:42:33.158" }, { "ProductID": 14, "UnitsInStock": 312, "ProductDescription": "ss", "UnitPrice": 385.13209223054912, "DateAdded": "2004-10-22T09:40:29.963" }, { "ProductID": 15, "UnitsInStock": 633, "ProductDescription": "od sf", "UnitPrice": 235.23991938458752, "DateAdded": "2004-05-24T06:23:10.957" }, { "ProductID": 16, "UnitsInStock": 965, "ProductDescription": "tyga", "UnitPrice": 752.16047640524835, "DateAdded": "2005-02-23T15:06:41.18" }, { "ProductID": 17, "UnitsInStock": 72, "ProductDescription": "ywlwusohgvo", "UnitPrice": 215.36414335265948, "DateAdded": "2006-06-11T21:34:45.119" }, { "ProductID": 18, "UnitsInStock": 633, "ProductDescription": "ykxdd yn f", "UnitPrice": 798.62704817141741, "DateAdded": "2006-06-11T03:33:01.995" }, { "ProductID": 19, "UnitsInStock": 60, "ProductDescription": "ankqxjscm", "UnitPrice": 796.89387827967, "DateAdded": "2001-05-01T21:30:39.398" }, { "ProductID": 20, "UnitsInStock": 418, "ProductDescription": "xi smc", "UnitPrice": 166.32680602666309, "DateAdded": "1999-11-08T04:18:26.323" }, { "ProductID": 21, "UnitsInStock": 599, "ProductDescription": "mwtyilp ym", "UnitPrice": 618.8996916724833, "DateAdded": "1998-10-28T10:11:34.597" }, { "ProductID": 22, "UnitsInStock": 325, "ProductDescription": "nuf", "UnitPrice": 72.543906081721147, "DateAdded": "2007-07-20T09:36:42.08" }, { "ProductID": 23, "UnitsInStock": 941, "ProductDescription": "ss", "UnitPrice": 612.84645349385517, "DateAdded": "1995-08-05T13:42:33.699" }, { "ProductID": 24, "UnitsInStock": 217, "ProductDescription": "mgpwjksxscjj", "UnitPrice": 657.09441185793582, "DateAdded": "2007-11-20T08:11:22.615" }, { "ProductID": 25, "UnitsInStock": 781, "ProductDescription": "vtr ue", "UnitPrice": 673.03995959136626, "DateAdded": "2008-08-09T20:59:46.701" }, { "ProductID": 26, "UnitsInStock": 94, "ProductDescription": "qqsddx", "UnitPrice": 132.44914921580309, "DateAdded": "2002-06-13T19:33:21.55" }, { "ProductID": 27, "UnitsInStock": 139, "ProductDescription": "ipeunftru", "UnitPrice": 683.31926208144023, "DateAdded": "1997-09-12T19:24:21.495" }, { "ProductID": 28, "UnitsInStock": 81, "ProductDescription": "hvuhd", "UnitPrice": 143.33922841741668, "DateAdded": "1999-06-24T23:21:25.746" }, { "ProductID": 29, "UnitsInStock": 615, "ProductDescription": "twtbdoxlf", "UnitPrice": 160.1419309899872, "DateAdded": "2005-10-24T06:26:37.963" }, { "ProductID": 30, "UnitsInStock": 53, "ProductDescription": "f", "UnitPrice": 578.44021151701, "DateAdded": "2008-04-21T04:53:22.055" }, { "ProductID": 31, "UnitsInStock": 454, "ProductDescription": "kxbjgogk", "UnitPrice": 322.45484009499421, "DateAdded": "2000-09-06T03:30:36.299" }, { "ProductID": 32, "UnitsInStock": 610, "ProductDescription": "iubpuh laeti", "UnitPrice": 426.5437672969623, "DateAdded": "1995-04-20T00:45:22.46" }, { "ProductID": 33, "UnitsInStock": 360, "ProductDescription": "fpfk", "UnitPrice": 736.387722537102, "DateAdded": "2003-01-01T08:03:06.252" }, { "ProductID": 34, "UnitsInStock": 868, "ProductDescription": "pjoetrfn", "UnitPrice": 853.77230860934242, "DateAdded": "1999-09-17T08:55:51.888" }, { "ProductID": 35, "UnitsInStock": 807, "ProductDescription": "xjjfvynfdsy", "UnitPrice": 286.56418122656839, "DateAdded": "1998-04-07T04:00:47.349" }, { "ProductID": 36, "UnitsInStock": 978, "ProductDescription": "rcd", "UnitPrice": 206.16455246050123, "DateAdded": "2007-04-16T16:43:46.688" }, { "ProductID": 37, "UnitsInStock": 972, "ProductDescription": " kruqh", "UnitPrice": 942.10701526240769, "DateAdded": "1998-04-25T12:01:57.17" }, { "ProductID": 38, "UnitsInStock": 501, "ProductDescription": "el", "UnitPrice": 375.25879096950348, "DateAdded": "2007-07-26T14:15:39.181" }, { "ProductID": 39, "UnitsInStock": 230, "ProductDescription": "osyplwjhyumn", "UnitPrice": 408.765922490864, "DateAdded": "2005-06-09T07:37:17.289" }, { "ProductID": 40, "UnitsInStock": 109, "ProductDescription": "wljxnagegxfv", "UnitPrice": 73.1784287249569, "DateAdded": "2006-02-04T19:28:26.712" }, { "ProductID": 41, "UnitsInStock": 603, "ProductDescription": "ldnku", "UnitPrice": 334.99470275593671, "DateAdded": "2009-10-05T06:57:46.643" }, { "ProductID": 42, "UnitsInStock": 131, "ProductDescription": "j", "UnitPrice": 829.44868497059156, "DateAdded": "2007-10-31T01:04:43.879" }, { "ProductID": 43, "UnitsInStock": 795, "ProductDescription": "ut en", "UnitPrice": 894.20529310321683, "DateAdded": "2001-09-13T12:58:28.07" }, { "ProductID": 44, "UnitsInStock": 293, "ProductDescription": "nltimq", "UnitPrice": 533.60006005205219, "DateAdded": "1998-08-13T23:23:50.173" }, { "ProductID": 45, "UnitsInStock": 250, "ProductDescription": "dbf", "UnitPrice": 130.89077646419909, "DateAdded": "2004-12-19T06:07:47.268" }, { "ProductID": 46, "UnitsInStock": 154, "ProductDescription": "lfwcekj", "UnitPrice": 903.20346360244014, "DateAdded": "1997-03-23T01:49:51.478" }, { "ProductID": 47, "UnitsInStock": 430, "ProductDescription": "vdrwds yayl", "UnitPrice": 472.05557183923924, "DateAdded": "2002-09-28T11:37:09.981" }, { "ProductID": 48, "UnitsInStock": 161, "ProductDescription": "pogoqha", "UnitPrice": 991.82122200346612, "DateAdded": "2000-12-18T07:06:31.862" }, { "ProductID": 49, "UnitsInStock": 187, "ProductDescription": "gh ik", "UnitPrice": 364.5047160631533, "DateAdded": "1998-06-07T05:08:01.531" }, { "ProductID": 50, "UnitsInStock": 667, "ProductDescription": "amgwl", "UnitPrice": 116.8721519023516, "DateAdded": "2005-05-08T23:54:46.015" }, { "ProductID": 51, "UnitsInStock": 91, "ProductDescription": " tiyptuo", "UnitPrice": 566.865128728964, "DateAdded": "2006-04-30T12:56:01.418" }, { "ProductID": 52, "UnitsInStock": 528, "ProductDescription": "dhrtlqxrnb", "UnitPrice": 243.15805465130043, "DateAdded": "2007-09-29T16:42:41.55" }, { "ProductID": 53, "UnitsInStock": 766, "ProductDescription": "chjbnpy", "UnitPrice": 404.27260026534674, "DateAdded": "2000-08-06T08:51:17.153" }, { "ProductID": 54, "UnitsInStock": 398, "ProductDescription": "g", "UnitPrice": 708.64396854706285, "DateAdded": "1998-05-28T16:19:12.809" }, { "ProductID": 55, "UnitsInStock": 542, "ProductDescription": "tlcpwenc ks", "UnitPrice": 378.91984934868282, "DateAdded": "1995-08-28T12:06:32.262" }, { "ProductID": 56, "UnitsInStock": 918, "ProductDescription": "mecqlel", "UnitPrice": 198.87779010407525, "DateAdded": "2008-03-06T12:17:24.924" }, { "ProductID": 57, "UnitsInStock": 790, "ProductDescription": "xhsdyrdrht", "UnitPrice": 711.87262083956625, "DateAdded": "1997-02-26T11:49:06.405" }, { "ProductID": 58, "UnitsInStock": 608, "ProductDescription": "tfbbwoikvmbo", "UnitPrice": 545.16117626110145, "DateAdded": "1995-12-18T23:49:41.345" }, { "ProductID": 59, "UnitsInStock": 640, "ProductDescription": "gfucf", "UnitPrice": 234.14456715534655, "DateAdded": "2000-11-30T12:15:19.798" }, { "ProductID": 60, "UnitsInStock": 839, "ProductDescription": " ehotu", "UnitPrice": 72.511365670948933, "DateAdded": "2002-10-25T19:59:23.284" }, { "ProductID": 61, "UnitsInStock": 764, "ProductDescription": "xibydjlle", "UnitPrice": 85.70026330915293, "DateAdded": "2000-10-10T06:15:18.008" }, { "ProductID": 62, "UnitsInStock": 172, "ProductDescription": "ay", "UnitPrice": 495.67054747402227, "DateAdded": "2001-10-14T19:42:12.497" }, { "ProductID": 63, "UnitsInStock": 312, "ProductDescription": "pnvfpv", "UnitPrice": 395.8704999628805, "DateAdded": "1995-04-07T14:24:33.822" }, { "ProductID": 64, "UnitsInStock": 849, "ProductDescription": "r", "UnitPrice": 11.491903574900656, "DateAdded": "1995-11-17T02:51:42.781" }, { "ProductID": 65, "UnitsInStock": 782, "ProductDescription": "rydgp", "UnitPrice": 702.09076567650345, "DateAdded": "2006-10-13T00:26:13.548" }, { "ProductID": 66, "UnitsInStock": 763, "ProductDescription": "sbv", "UnitPrice": 101.91137441522972, "DateAdded": "1999-03-21T12:26:57.362" }, { "ProductID": 67, "UnitsInStock": 632, "ProductDescription": "is b", "UnitPrice": 159.14618091618, "DateAdded": "1995-12-31T01:33:36.165" }, { "ProductID": 68, "UnitsInStock": 113, "ProductDescription": "btjpjm", "UnitPrice": 74.208359734252255, "DateAdded": "1999-11-25T03:23:35.227" }, { "ProductID": 69, "UnitsInStock": 390, "ProductDescription": "i gdqtvtr", "UnitPrice": 503.52983013891139, "DateAdded": "2003-02-21T20:37:50.4" }, { "ProductID": 70, "UnitsInStock": 13, "ProductDescription": "seti", "UnitPrice": 250.57762407258971, "DateAdded": "1995-05-22T07:27:29.425" }, { "ProductID": 71, "UnitsInStock": 671, "ProductDescription": "pvs", "UnitPrice": 175.73818898561328, "DateAdded": "2007-11-05T10:07:00.186" }, { "ProductID": 72, "UnitsInStock": 304, "ProductDescription": "iq", "UnitPrice": 678.63394537877014, "DateAdded": "2006-06-25T05:19:18.472" }, { "ProductID": 73, "UnitsInStock": 470, "ProductDescription": "wpydb", "UnitPrice": 245.97826658095153, "DateAdded": "1998-09-05T03:18:53.584" }, { "ProductID": 74, "UnitsInStock": 381, "ProductDescription": "owblq", "UnitPrice": 414.01967937779597, "DateAdded": "2003-12-25T21:10:19.182" }, { "ProductID": 75, "UnitsInStock": 160, "ProductDescription": "grnrdnyulr", "UnitPrice": 411.3361143559851, "DateAdded": "1995-07-19T09:52:37.513" }, { "ProductID": 76, "UnitsInStock": 825, "ProductDescription": "nxuouddtku", "UnitPrice": 266.08534728460262, "DateAdded": "1998-08-28T00:38:31.392" }, { "ProductID": 77, "UnitsInStock": 834, "ProductDescription": "i", "UnitPrice": 640.74717631598332, "DateAdded": "2006-02-06T02:50:14.015" }, { "ProductID": 78, "UnitsInStock": 769, "ProductDescription": "vlsuelj", "UnitPrice": 189.06204876911923, "DateAdded": "1999-04-25T23:13:59.326" }, { "ProductID": 79, "UnitsInStock": 763, "ProductDescription": "yhtcnnv", "UnitPrice": 817.48775989631554, "DateAdded": "2006-08-23T15:57:15.484" }, { "ProductID": 80, "UnitsInStock": 992, "ProductDescription": "mgrkwswku", "UnitPrice": 971.172345788764, "DateAdded": "2004-08-21T14:12:21.272" }, { "ProductID": 81, "UnitsInStock": 536, "ProductDescription": "htbpcjyv wvx", "UnitPrice": 459.84873243600538, "DateAdded": "2005-07-26T19:21:39.206" }, { "ProductID": 82, "UnitsInStock": 531, "ProductDescription": "twymdxkbsn", "UnitPrice": 674.19442612407465, "DateAdded": "1999-02-18T09:40:38.65" }, { "ProductID": 83, "UnitsInStock": 841, "ProductDescription": "nhtuuskeqi t", "UnitPrice": 503.89090203861286, "DateAdded": "2001-01-18T21:01:48.02" }, { "ProductID": 84, "UnitsInStock": 860, "ProductDescription": "k ipaap", "UnitPrice": 25.712588348292087, "DateAdded": "2006-10-01T18:16:51.542" }, { "ProductID": 85, "UnitsInStock": 369, "ProductDescription": " vosr", "UnitPrice": 25.936719973542132, "DateAdded": "1996-06-16T19:48:24.438" }, { "ProductID": 86, "UnitsInStock": 329, "ProductDescription": "cpwtinf", "UnitPrice": 630.37060137389722, "DateAdded": "2002-06-17T02:52:02.518" }, { "ProductID": 87, "UnitsInStock": 384, "ProductDescription": "afebpw", "UnitPrice": 194.15147844429663, "DateAdded": "2008-01-17T19:23:42.176" }, { "ProductID": 88, "UnitsInStock": 515, "ProductDescription": "t kjkibph", "UnitPrice": 776.26849281427849, "DateAdded": "2001-02-03T23:27:27.862" }, { "ProductID": 89, "UnitsInStock": 75, "ProductDescription": "juco", "UnitPrice": 292.54317995744907, "DateAdded": "2002-04-16T11:13:45.774" }, { "ProductID": 90, "UnitsInStock": 810, "ProductDescription": "m", "UnitPrice": 400.07937159392952, "DateAdded": "2008-12-02T18:27:17.421" }, { "ProductID": 91, "UnitsInStock": 287, "ProductDescription": "qlbuueuvip", "UnitPrice": 440.69923201608435, "DateAdded": "2000-04-10T04:19:52.399" }, { "ProductID": 92, "UnitsInStock": 917, "ProductDescription": "c d", "UnitPrice": 607.5355525163634, "DateAdded": "1995-07-02T08:38:36.906" }, { "ProductID": 93, "UnitsInStock": 977, "ProductDescription": "ugmgwirpfpm", "UnitPrice": 134.35918750910051, "DateAdded": "2005-02-08T22:36:16.636" }, { "ProductID": 94, "UnitsInStock": 683, "ProductDescription": "mlxdfl e", "UnitPrice": 698.53304498760633, "DateAdded": "1998-11-15T19:17:19.081" }, { "ProductID": 95, "UnitsInStock": 376, "ProductDescription": "q ht", "UnitPrice": 895.41713283183856, "DateAdded": "1999-08-23T21:25:25.151" }, { "ProductID": 96, "UnitsInStock": 848, "ProductDescription": "eomxubecywe", "UnitPrice": 242.67157364761064, "DateAdded": "2002-12-19T22:32:57.428" }, { "ProductID": 97, "UnitsInStock": 531, "ProductDescription": "qqvrkt", "UnitPrice": 93.191324776593277, "DateAdded": "2007-02-14T09:19:16.24" }, { "ProductID": 98, "UnitsInStock": 25, "ProductDescription": "b pwupu", "UnitPrice": 827.32010252183306, "DateAdded": "2007-07-29T05:42:29.744" }, { "ProductID": 99, "UnitsInStock": 406, "ProductDescription": "y hcgwetacsc", "UnitPrice": 524.93245551592315, "DateAdded": "2004-09-14T11:19:59.306" }, { "ProductID": 100, "UnitsInStock": 130, "ProductDescription": "o", "UnitPrice": 406.7193448574838, "DateAdded": "1995-08-30T17:17:03.921" }, { "ProductID": 101, "UnitsInStock": 111, "ProductDescription": "mjsanecgjj", "UnitPrice": 692.73090581071142, "DateAdded": "1996-11-17T18:47:14.361" }, { "ProductID": 102, "UnitsInStock": 549, "ProductDescription": "pmndww yj", "UnitPrice": 370.45298114905739, "DateAdded": "2008-06-14T03:38:19.026" }, { "ProductID": 103, "UnitsInStock": 118, "ProductDescription": "roej", "UnitPrice": 794.6150977139431, "DateAdded": "1999-06-01T12:46:53.499" }, { "ProductID": 104, "UnitsInStock": 159, "ProductDescription": "oobrqa", "UnitPrice": 479.06922850714494, "DateAdded": "2004-09-18T09:35:39.31" }, { "ProductID": 105, "UnitsInStock": 718, "ProductDescription": " ", "UnitPrice": 976.45797486252059, "DateAdded": "2008-11-16T00:43:18.077" }, { "ProductID": 106, "UnitsInStock": 481, "ProductDescription": " fcesm ", "UnitPrice": 361.119903326556, "DateAdded": "1997-08-20T10:14:29.703" }, { "ProductID": 107, "UnitsInStock": 441, "ProductDescription": "krdywujfawlk", "UnitPrice": 209.73492330393518, "DateAdded": "2007-05-19T16:49:19.514" }, { "ProductID": 108, "UnitsInStock": 553, "ProductDescription": "qhvch", "UnitPrice": 227.35544490970457, "DateAdded": "1995-11-12T20:34:01.365" }, { "ProductID": 109, "UnitsInStock": 202, "ProductDescription": "paj", "UnitPrice": 946.41784948595694, "DateAdded": "2003-12-26T00:17:11.472" }, { "ProductID": 110, "UnitsInStock": 244, "ProductDescription": "grpslrcdoqk", "UnitPrice": 611.99955298192776, "DateAdded": "2003-02-25T05:37:39.102" }, { "ProductID": 111, "UnitsInStock": 790, "ProductDescription": "jedhaggpeqxu", "UnitPrice": 251.46885414210561, "DateAdded": "2006-06-01T01:50:04.246" }, { "ProductID": 112, "UnitsInStock": 980, "ProductDescription": "kqod", "UnitPrice": 482.94913418728351, "DateAdded": "1998-01-31T22:29:37.016" }, { "ProductID": 113, "UnitsInStock": 790, "ProductDescription": "xdrnqtkqjrq", "UnitPrice": 215.92777884375667, "DateAdded": "2006-06-02T19:21:23.381" }, { "ProductID": 114, "UnitsInStock": 265, "ProductDescription": "oyb", "UnitPrice": 407.69941192478848, "DateAdded": "1996-07-29T10:52:51.702" }, { "ProductID": 115, "UnitsInStock": 525, "ProductDescription": "wjoi xxokej", "UnitPrice": 335.21663832255484, "DateAdded": "2000-09-24T09:06:38.814" }, { "ProductID": 116, "UnitsInStock": 867, "ProductDescription": "sykegknb", "UnitPrice": 763.80201883791108, "DateAdded": "2003-03-15T12:02:04.86" }, { "ProductID": 117, "UnitsInStock": 176, "ProductDescription": "yeitqh", "UnitPrice": 44.78435173853503, "DateAdded": "1999-02-05T05:44:40.588" }, { "ProductID": 118, "UnitsInStock": 282, "ProductDescription": "gtmrtflukvh ", "UnitPrice": 230.83485580553992, "DateAdded": "1996-12-20T05:22:33.945" }, { "ProductID": 119, "UnitsInStock": 981, "ProductDescription": "elihuuulyja", "UnitPrice": 395.23975383268657, "DateAdded": "2005-10-22T20:42:37.372" }, { "ProductID": 120, "UnitsInStock": 11, "ProductDescription": "ohtqp", "UnitPrice": 710.1865055552621, "DateAdded": "2004-02-07T13:42:36.238" }, { "ProductID": 121, "UnitsInStock": 648, "ProductDescription": "oxcg", "UnitPrice": 125.85057277504846, "DateAdded": "2009-04-01T19:05:11.614" }, { "ProductID": 122, "UnitsInStock": 971, "ProductDescription": "utbn", "UnitPrice": 917.63626919949252, "DateAdded": "2009-04-08T01:26:55.574" }, { "ProductID": 123, "UnitsInStock": 107, "ProductDescription": "x ridb", "UnitPrice": 89.498646599007131, "DateAdded": "2001-03-27T13:23:31.573" }, { "ProductID": 124, "UnitsInStock": 545, "ProductDescription": "rklhdouar", "UnitPrice": 889.28472664639571, "DateAdded": "2005-05-26T06:27:17.143" }, { "ProductID": 125, "UnitsInStock": 535, "ProductDescription": " kuox", "UnitPrice": 906.78467736895414, "DateAdded": "2006-08-23T06:41:07.132" }, { "ProductID": 126, "UnitsInStock": 677, "ProductDescription": "qdqqw", "UnitPrice": 282.04300407415394, "DateAdded": "1996-08-12T11:32:12.76" }, { "ProductID": 127, "UnitsInStock": 533, "ProductDescription": "rsifmtlolrv", "UnitPrice": 236.68014734828853, "DateAdded": "1998-04-04T04:20:24.587" }, { "ProductID": 128, "UnitsInStock": 792, "ProductDescription": "qqximd", "UnitPrice": 509.20765218753729, "DateAdded": "2006-07-03T15:57:19.286" }, { "ProductID": 129, "UnitsInStock": 69, "ProductDescription": "sgplr", "UnitPrice": 554.71408625818515, "DateAdded": "2009-05-12T08:35:41.104" }, { "ProductID": 130, "UnitsInStock": 183, "ProductDescription": "y", "UnitPrice": 784.56183140378528, "DateAdded": "2009-07-28T19:10:09.689" }, { "ProductID": 131, "UnitsInStock": 801, "ProductDescription": " bhjaucljg ", "UnitPrice": 228.06825033764739, "DateAdded": "2000-05-16T15:17:10.376" }, { "ProductID": 132, "UnitsInStock": 744, "ProductDescription": "r", "UnitPrice": 195.34906288392332, "DateAdded": "2009-09-20T19:39:01.143" }, { "ProductID": 133, "UnitsInStock": 314, "ProductDescription": "tmubtdwadtp", "UnitPrice": 696.49526742123783, "DateAdded": "2008-01-18T10:12:29.334" }, { "ProductID": 134, "UnitsInStock": 17, "ProductDescription": "jubrf", "UnitPrice": 237.17973718288343, "DateAdded": "1999-02-17T08:49:54.971" }, { "ProductID": 135, "UnitsInStock": 892, "ProductDescription": "lleec", "UnitPrice": 321.87175346625583, "DateAdded": "2006-11-25T06:50:07.939" }, { "ProductID": 136, "UnitsInStock": 803, "ProductDescription": "wcmfepvx", "UnitPrice": 65.4061897962383, "DateAdded": "1999-03-13T01:39:13.916" }, { "ProductID": 137, "UnitsInStock": 589, "ProductDescription": "hihjpvbf", "UnitPrice": 69.484362411072638, "DateAdded": "2004-08-22T12:19:38.245" }, { "ProductID": 138, "UnitsInStock": 513, "ProductDescription": "kpgyqwv ", "UnitPrice": 833.48741095209846, "DateAdded": "1995-07-26T22:44:48.87" }, { "ProductID": 139, "UnitsInStock": 951, "ProductDescription": "ucpkuhdygsc", "UnitPrice": 129.05014871109748, "DateAdded": "2007-10-24T04:38:18.502" }, { "ProductID": 140, "UnitsInStock": 808, "ProductDescription": "kqmogow", "UnitPrice": 797.42742413535132, "DateAdded": "2003-07-05T09:59:37.963" }, { "ProductID": 141, "UnitsInStock": 353, "ProductDescription": "fdjotgjkole", "UnitPrice": 651.32445639526679, "DateAdded": "2001-07-11T17:42:23.628" }, { "ProductID": 142, "UnitsInStock": 756, "ProductDescription": "mhrldc", "UnitPrice": 871.64238880930577, "DateAdded": "2000-07-05T06:24:13.773" }, { "ProductID": 143, "UnitsInStock": 412, "ProductDescription": "gkqg", "UnitPrice": 909.90516446060747, "DateAdded": "2000-04-12T09:32:40.409" }, { "ProductID": 144, "UnitsInStock": 67, "ProductDescription": "wa", "UnitPrice": 7.1308082002824218, "DateAdded": "2003-10-12T06:32:00.417" }, { "ProductID": 145, "UnitsInStock": 724, "ProductDescription": "vrjeaeabutbo", "UnitPrice": 77.720387874972246, "DateAdded": "1996-03-28T06:54:48.119" }, { "ProductID": 146, "UnitsInStock": 193, "ProductDescription": "ityfmuscqc", "UnitPrice": 163.90651425528642, "DateAdded": "2003-04-13T13:25:14.071" }, { "ProductID": 147, "UnitsInStock": 514, "ProductDescription": "lxotpkrqg", "UnitPrice": 183.99474452435726, "DateAdded": "1999-03-01T09:11:10.708" }, { "ProductID": 148, "UnitsInStock": 199, "ProductDescription": "vehgywcq", "UnitPrice": 210.02538884525438, "DateAdded": "2003-10-21T23:24:14.567" }, { "ProductID": 149, "UnitsInStock": 462, "ProductDescription": " yfmxa", "UnitPrice": 487.34869364991255, "DateAdded": "2003-10-16T14:36:09.629" }, { "ProductID": 150, "UnitsInStock": 141, "ProductDescription": "d gls", "UnitPrice": 83.93322028402855, "DateAdded": "2005-10-31T05:29:15.881" }, { "ProductID": 151, "UnitsInStock": 493, "ProductDescription": "ygevxiudpi", "UnitPrice": 10.332782757623486, "DateAdded": "1998-10-24T02:57:31.939" }, { "ProductID": 152, "UnitsInStock": 344, "ProductDescription": "ho", "UnitPrice": 449.63127255888247, "DateAdded": "2001-09-21T02:04:44.407" }, { "ProductID": 153, "UnitsInStock": 126, "ProductDescription": "ctolm", "UnitPrice": 42.899200247088075, "DateAdded": "1999-10-01T15:40:13.048" }, { "ProductID": 154, "UnitsInStock": 976, "ProductDescription": "caxrtlc", "UnitPrice": 811.81130782319758, "DateAdded": "1996-11-03T18:52:15.123" }, { "ProductID": 155, "UnitsInStock": 309, "ProductDescription": "bvu", "UnitPrice": 203.36372554458851, "DateAdded": "1996-12-12T05:08:13.027" }, { "ProductID": 156, "UnitsInStock": 87, "ProductDescription": "vxvgpocreq", "UnitPrice": 746.06413475520174, "DateAdded": "2000-01-25T23:17:57.132" }, { "ProductID": 157, "UnitsInStock": 908, "ProductDescription": "v", "UnitPrice": 663.14971757268063, "DateAdded": "2002-06-05T19:52:49.818" }, { "ProductID": 158, "UnitsInStock": 337, "ProductDescription": "m", "UnitPrice": 570.49806442600584, "DateAdded": "2004-10-06T05:46:21.239" }, { "ProductID": 159, "UnitsInStock": 204, "ProductDescription": "hcxffxjhke", "UnitPrice": 443.62677095626793, "DateAdded": "1995-03-24T10:25:33.912" }, { "ProductID": 160, "UnitsInStock": 635, "ProductDescription": "jiobgkatjcf", "UnitPrice": 220.47762443333755, "DateAdded": "2000-03-06T04:52:55.539" }, { "ProductID": 161, "UnitsInStock": 867, "ProductDescription": "n", "UnitPrice": 244.6300272106333, "DateAdded": "1998-04-29T13:20:24.075" }, { "ProductID": 162, "UnitsInStock": 757, "ProductDescription": "yl", "UnitPrice": 639.6004174089062, "DateAdded": "2008-01-17T09:51:30.555" }, { "ProductID": 163, "UnitsInStock": 458, "ProductDescription": "gjw", "UnitPrice": 679.68895317972124, "DateAdded": "2004-01-20T13:01:06.279" }, { "ProductID": 164, "UnitsInStock": 854, "ProductDescription": "p", "UnitPrice": 925.4816914561585, "DateAdded": "2005-04-19T23:25:03.024" }, { "ProductID": 165, "UnitsInStock": 950, "ProductDescription": "isrnsu", "UnitPrice": 29.671415234762904, "DateAdded": "1995-03-29T10:13:37.291" }, { "ProductID": 166, "UnitsInStock": 605, "ProductDescription": "fwyefmv", "UnitPrice": 915.249941365444, "DateAdded": "2005-11-04T02:40:16.597" }, { "ProductID": 167, "UnitsInStock": 717, "ProductDescription": " dqwrmid", "UnitPrice": 695.43330636594135, "DateAdded": "2009-02-10T00:37:14.352" }, { "ProductID": 168, "UnitsInStock": 393, "ProductDescription": "svyjkstu", "UnitPrice": 441.74571123055449, "DateAdded": "2004-08-08T06:13:18.048" }, { "ProductID": 169, "UnitsInStock": 743, "ProductDescription": " r", "UnitPrice": 382.14460219356442, "DateAdded": "2003-12-01T16:16:08.421" }, { "ProductID": 170, "UnitsInStock": 507, "ProductDescription": " yfvhoaq h", "UnitPrice": 652.19372355015662, "DateAdded": "2007-05-12T13:23:50.465" }, { "ProductID": 171, "UnitsInStock": 909, "ProductDescription": "vgeifckd", "UnitPrice": 921.660645362763, "DateAdded": "2008-02-18T09:48:54.688" }, { "ProductID": 172, "UnitsInStock": 180, "ProductDescription": "jmv c", "UnitPrice": 782.65068250831712, "DateAdded": "2005-04-07T15:01:41.249" }, { "ProductID": 173, "UnitsInStock": 913, "ProductDescription": "kivmjitsldps", "UnitPrice": 141.83542092416221, "DateAdded": "1998-12-14T09:57:49.787" }, { "ProductID": 174, "UnitsInStock": 719, "ProductDescription": " hjiva", "UnitPrice": 356.87426773685695, "DateAdded": "2005-05-09T10:18:28.555" }, { "ProductID": 175, "UnitsInStock": 933, "ProductDescription": "mty", "UnitPrice": 188.27982162510966, "DateAdded": "2008-01-13T17:57:20.134" }, { "ProductID": 176, "UnitsInStock": 140, "ProductDescription": "qkwiuvspjkqn", "UnitPrice": 665.80213078567863, "DateAdded": "1999-02-17T18:59:21.737" }, { "ProductID": 177, "UnitsInStock": 266, "ProductDescription": "nc", "UnitPrice": 451.497463254024, "DateAdded": "1999-06-05T07:23:23.881" }
    			],
    			"TotalRecordsCount": 250,
    			"Metadata": {}
    		}; 
    	</script>
    
    	<script type="text/javascript">
    		$.ig.loader({
    			scriptPath: "http://cdn-na.infragistics.com/igniteui/2017.1/latest/js/",
    			cssPath: "http://cdn-na.infragistics.com/igniteui/2017.1/latest/css/",
    			resources: "igGrid.*"
    		});
    	    
    		$.ig.loader(function () {
    			$("#grid").igGrid({
    				autoGenerateColumns: true,
    				primaryKey: "ProductID",
    				autoCommit: true,
    				width: "700px",
    				height: "500px",
    				rowVirtualization: true,
    			    virtualizationMode: "continuous",
    				columns: [
    					{ headerText: "MCH1", key: "mch1", group: [
    						{ headerText: "Product ID", key: "ProductID", dataType: "number" },
    						{ headerText: "Stock", key: "UnitsInStock", dataType: "number", hidden: true }
    					] },
    					{ headerText: "MCH2", key: "mch2", group: [
    						{ headerText: "Description", key: "ProductDescription", dataType: "string", hidden: true },
    						{ headerText: "UnitPrice", key: "UnitPrice", dataType: "number", format: "#.##" },
    						{ headerText: "DateAdded", key: "DateAdded", dataType: "date", format: "dateTime" }
    					] }
    				],
    				dataSource: sourceData,
    				responseDataKey: "Products",
    				features: [
    					{
    						name: "Hiding"
    					},
    					{
    						name: "MultiColumnHeaders"
    					}
    				]
    			});
    		});
    		
    		function f() {
    			$("#grid").igGridHiding("showMultiColumns", [ "UnitsInStock", "ProductDescription" ]);
    			$("#grid").igGridHiding("hideMultiColumns", [ "ProductID", "DateAdded" ])
    		}
        </script>
    </head>
    <body>
    	  <button onclick="f()">click</button>
        <table id="grid"></table>
    </body>
    </html>