Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1355
Change data of igHierarchicalGrid after combobox indexchanged
posted

hi,

i have an cobobox. i want igHierarchicalGrid changed when i change combobox then the grid change

please help me how can i do it!

please give me a sample

thanks you very much!

Parents
  • 11095
    Verified Answer
    Offline posted

    Hello Cuong,

    Thank you for contacting Infragistics Developer Support!

    You can change the grid dataSource using the combo event selectionChanged. You can set the new dataSource of the grid by using the dataSource property setter and calling dataBind to apply changes.

    $("#combo").igCombo({
    	dataSource: [
    		{'dataSourceId': 'dataSource1' },
    		{'dataSourceId': 'dataSource2' },
    		{'dataSourceId': 'dataSource3' },
    		{'dataSourceId': 'dataSource4' },
    		{'dataSourceId': 'dataSource5' }
    	],
    	textKey: 'dataSourceId',
    	valueKey: 'dataSourceId',
    	width: '200px',
    	selectionChanged: function(evt, ui) {
    		var selection = ui.items[0];
    
    		switch (selection) {
    			case 'dataSource1':
    				$('#hierarchicalGrid').igGrid('options','dataSource', dataSource1);
    				break;
    				/* .
                                       .
                                       . */
    			default:
    				break;
    		}
                    $('#hierarchicalGrid').igGrid('dataBind');
    	}
    });
    

    Do not hesitate to contact me if you have additional questions.

Reply Children