Hi,
I'm trying to use the following in order to capture combo box selection changes, then update the caption to my igGrid (for starters):
I can indeed update my grid's "caption"; however I'm always getting the PREVIOUS selection - not the current text item which was just selected.
Also, can you advise me on how to use the evt and ui objects ? i can't find good documentation on that.
thank you.
Bob
I realized I was using the wrong event method, so I changed it to "igcomboselectionchanged":
$(document).delegate("#filterCombo", "igcomboselectionchanged", function (evt, ui) { // COMBO BOX CHANGE EVENT ! var selText = $(this).igCombo("text"); $("#pfGrid").igGrid("option","caption", selText); });
But still trying to get an understanding of how to use the "evt" and "ui" objects. Any examples please ?
Hello Bob,
D. is correct.
To be more precise, the "evt" and "ui" objects are documented in each event code snippet of the control's API docs.
Here is an extract from the igCombo.selectionChanged event:
$(document).delegate(
".selector"
,
"igcomboselectionchanged"
function
(evt
, ui) {
//use to obtain reference to the event browser
evt.originalEvent;
//use to obtain reference to igCombo
ui.owner;
//use to obtain reference to array of new selected items. That can be null.
ui.items;
//use to obtain reference to array of old selected items. That can be null.
ui.oldItems;
});
Best regards, Martin Pavlov Infragistics, Inc.
Thank you D. I C#, that's exactly what I would have done.
However, I didn't realize I could simply set a debugger in my Javascript and inspect all my objects at that point.
It works great.
regards,
Try putting a debugger; line in your javascript. Then you can debug in Visual Studio or your browser and examine all of the properties on that object.
Hi Martin,
Thanks for your reply. I have seen those docs, and after some trial and error I finally have something working.
I can indeed see the alert(evt.originalEvent + " " + ui.owner); showing an "Object" for both items.
Now I just need to investigate further re: how to drill into those objects and parse through the relevant info/properties (i.e. the .Net IntelliSense is not rendering all the properties).
Regards,