Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
300
Looking for a way to subscribe to dataSource event on igCombo
posted

Hello, I am looking for a way to subscribe to an event on the dataSource of an igCombo that uses loadOnDemand and dataSourceUrl. Specifically, I am looking to use "urlParamsEncoded". It appears that a dataSource is generated on initialization but I have hit a wall trying to find the event. I am unable to create an $.ig.dataSource and use this on the combo because it breaks the loadOnDemand functionallity. I am using v2013.1. Thanks.

Parents
  • 4315
    Verified Answer
    Offline posted

    Hi, Bertm13.

    Sorry for the late response.

    The igDataSource itself doesn't support load on demand, you are right. What you can do is to attach to the dataBound igCombo event. It is fired every time a data is requested on demand. And inside that event you have access to the data source, therefore to its urlParamsEncoded setting. There you can attach to the handler or whatever else you want to do:

    dataBound: function (evt, ui) {
         ui.dataSource.settings.urlParamsEncoded = function (owner, params) { };
    }

    But be careful because this will attach new handler every time new data is requested on demand.

    Outside that event you can also use the following code, but only if you are sure that the control is already bound to data:

    $("#combo").igCombo("getDataSource").settings.urlParamsEncoded = function (owner, params) { };

    I hope this will help you and don't hesitate to ask if you have more questions.

    Best regards,

    Nikolay Alipiev

Reply Children