Author Topic: Event Listeners for Select Editors  (Read 4449 times)

jax

  • Newbie
  • *
  • Posts: 16
    • View Profile
Event Listeners for Select Editors
« on: June 23, 2014, 03:46:56 am »
Do the event listeners not work for Editor Select elements? The below 'change' function does not execute when I change the selection.

            colModel: [
                {
                    title: 'Data Type', width: 100, dataIndx: 'DataType',
                    editor: {
                        type: 'select',
                        options: ['Express Lane', 'Package Us', 'Safe Face'], listeners: [{
                            change: function (evt, ui) {
                                alert('it worked!');
                            }
                        }],
                    }
                },

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 5784
    • View Profile
Re: Event Listeners for Select Editors
« Reply #1 on: June 23, 2014, 08:29:25 am »
Editors don't have listeners property.

Change event can be bound to editor in the init callback.

init: function(ui){
   ui.$cell.find("select").change(function(evt){
       alert('something');
   });
}

API reference:
http://paramquery.com/pro/api#option-column-editor
« Last Edit: June 23, 2014, 09:02:29 am by paramquery »