In our project we had 2013.2 infragistics ignite ui for asp.net mvc. Recently we have upgrade to the most recent version wich is 2015.1.
We had to make some changes in our js code in order to use the new functions wich replaced the old ones.
Our principal issue in this moment is that we dynamically need to change the combo mode. They are: editable, readonly, readonlylist and dropdown, but when we try to set the combo as readonly it reaises an error as: Operation Not supported.
We can see in the documentation of 2015.1, exactly in this url (http://help.infragistics.com/jQuery/2015.1/ui.igcombo), that right now there is no a setter for readonly mode and when we try to set this option it raises the error above commented.
We thank in advance any help with this.
Hello,
Thank you for your question.
Currently combo does not support changing the mode option. Mode can be set only on combo initialization. If you want to disabled the combo (put it in readonly mode) you can use $('#ComboSelectionFiltre').igCombo('option', 'disabled', true).
Well, first of all, it worked like a charm, so many thanks.
However we are very concerned with this new release of infragistics 2015.1, specifically for jquery, asp.net mvc helpers, because we can see many methods in API publication web site Infragistics and they simply do not work correctly, by the other hand, the method that you shared wich solved our first problem, it is not in the API documentation.
Right now I am trying to select a item in IgCombo with this Code:
var currentItemSelected = $("#cmbTIpoSolicitud").igCombo('selectedItems'); var newDataSource = $("#cmbTIpoSolicitud").igCombo('items'); for (var i = 0; i < newDataSource.length; i++) { if (newDataSource[i].data.Id == "G") { newDataSource.splice(i, 1); // removes 1 element at position i break; } }
$("#cmbTIpoSolicitud").igCombo({ dataSource: newDataSource }); $("#cmbTIpoSolicitud").igCombo("dataBind");
$("#cmbTIpoSolicitud").igCombo("select", currentItemSelected);
But it does not work, I mean it does not select any item in igCombo.
Many thanks in advance.
I am glad that I've managed to help you.
About your questions, This is option which is inherited from the jQueryUI framework, after all our IgniteUI framework is based on the jQuery UI framework :). The only thing that this option do, is applying certain styles that will make the combo not editable:
http://api.jqueryui.com/jQuery.widget/#option-disabled
I am currently investigating the code that you`ve provided.
In order to select items you can use one of the methods "select" or "value".
If you choose "value", this will selects list item/items from the drop down list by specified value or array of values.
"select" will selects a list item from the drop down list, by providing the html <li> items that you want to select. My suggestion is to use "value" method, and below you will find a sample that is showing exactly how to use it.
http://jsfiddle.net/zdravko/43j37z1r/1/
References:
http://help.infragistics.com/jQuery/2015.1/ui.igcombo#methods:value
http://help.infragistics.com/jQuery/2015.1/ui.igcombo#methods:select