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
340
Error putting igTree in jQuery dialog
posted

I build the tree like this:

 

@(Html.Infragistics().Tree("Tree1", Model1.Tree1);

 

 

When I try to open a igTree inside a jQuery dialog doing this:

$('#select-states-button').click(function() {
       
var $dialog = $('#States').dialog({
autoOpen: false,
resizable: false,
width: 1000,
height: 800,
maxHeight: 800,
modal: true,
buttons: { "Ok": function()  { $(this).dialog("close"); } },
title: 'Select States'
});

$dialog.dialog('open');
// prevent the default action, e.g., following a link
return false;
       
});

I get this error in the file ig.ui.js:

 

case

 

 

'loadOnDemand':

 

 

 

throw new Error($.ig.Tree.locale.setOptionError + option);

 

I found a work around by not using the MVC helper function but instantiating the control in jquery.

 

$('#Tree1').igTree({ dataSource: [{"Name":"Alabama","StateId":1,"City":{}}, ... all the other courts are here... ], loadOnDemand: true, dataSourceUrl: '/Home/TreeGetData', checkboxMode: 'tristate', singleBranchExpand: true, parentNodeImageUrl: 'Computer.png', leafNodeImageUrl: 'Computer.png', bindings: { textKey: 'Name', primaryKey: 'StateId', valueKey: 'StateId', childDataProperty: 'Courts', bindings: { textKey: 'Name', primaryKey: 'CityId', valueKey: 'CityId' } } });

My question is how do I instantiate the control in jquery and use the parent data (Model.Tree1)?