2

I want to add load event in editoption of jqGrid.

My code is like this:

dataEvents: [
{
    type: 'change',
    fn: function (e)
    {
        Myfunction();
    }
},
{
    type: 'load',
    fn: function (e)
    {
        Myfunction();
    }
}]

My problem is: The change event is called very well, but the load event is not called.

khellang
  • 17,550
  • 6
  • 64
  • 84
Nisarg
  • 3,024
  • 5
  • 32
  • 54
  • Cam you explain when do you want to call the load event and the purpose of the load event – Kris Feb 11 '13 at 08:55

1 Answers1

0

I'm not sure in which situation you want that the handle of jQuery.load handler will be called. If you use dataUrl to load the <select> from the server then you can use buildSelect as replacement of "load" hendler. If the server returns already HTML fragment with <select> the buildSelect callbacl can be as following

dataUrl: "mySelectUrl",
buildSelect: function (data) {
    Myfunction();
    return data;
}
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • Thanks, I want to use this thing in thae case of two select box in edit form......scene is whene I select A from XYZ select box then the Option of PXR select box are S,Y,U and B from XYZ select box then the Option of PXR select box are K,L,O – Nisarg Feb 19 '13 at 14:54
  • @NisargPatel: You are welcome! Implementation of dependent selects is complex in the current version of jqGrid. See [the answer](http://stackoverflow.com/a/4480184/315935) which describes how one can do this in case of usage without `dataUrl`. Implementation in case of `dataUrl` will be mostly in the same way. – Oleg Feb 19 '13 at 15:04