Hi,
I am currently developing functionality on demand loading of data in the igcombo.What I want is to take the written text in the control and conduct a manual POST with text and other data. But I find nothing that I notice that text entry and pressed ENTER or TAB to search.I need an event which can detect this.any idea?
Hi Felipe,
It is not clear what exactly you try to do. If you want to keep track on text changes in igCombo, then the easiest way to process textChanged event. Below is example:
$('#combo1').igCombo({ textChanged: function (evt, ui) { var oldText = ui.oldText; var text = ui.text; var selIndex = ui.owner.selectedIndex(); var evtType = evt.originalEvent ? evt.originalEvent.type : null; }, dataSource: ["one", "two", "three", "four"]});
Next version of igCombo will have built-in load on demand functionality for remote data. In case of Mvc application or oData (netflix), application will need only enable option of igCombo.
Hi Victor,
what I need is to detect when you press ENTER to perform a search with the text the user entered.
In the TextChange event I can not detect whether the user pressed ENTER.
Unfortunately the custom keyboard, mouse and focus/blur events were considered unnecessary and they were removed from igCombo before release. It means that if application in interested in similar events, then it needs to do some extra work:1. find reference to html element(s) which can be the source for those events2. attach standard jquery handlers to that(those) element(s)3. find reference to owner-igCombo4. perform desired logic
Below is example to process keydown events over INPUT of igCombo. It checks for Enter (13) and Tab (9) keys and shows alert with few properties of igCombo.
Please let me know if you would be prefer to have similar event(s) exposed by igCombo same way as all other custom events like textChanged, dropDownOpening, etc.
$('#combo1').igCombo({ dataSource: ["one", "two", "three", "four"]}).find('INPUT').bind({ keydown: function(evt) { var keyCode = evt.keyCode; if (keyCode === 13 || keyCode === 9) { var combo = $('#combo2').data('igCombo'); if (combo) { alert('key:' + keyCode + ' text:' + combo.text() + ' value:' + combo.value() + ' sel:' + combo.selectedIndex()); } }}});