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 linkreturn 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)?
Hi there,
Is it possible for you to attach a small isolated sample that reproduces the issue and I would be happy to take a look at it and to help you further!
Thank you for using the Infragistics forums!
I've created a new project that just shows the error. Now it works without an error but you can't click on the tree. The project connects to a database. Do you want me to zip the project anyways? Where do I send it?