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
100
igGrid header rendered twice
posted

Because it is not possible to set the datasource of igGrid to Javascript-Variable with MVC helper (see other Post here), I tried a workaround: In rendered-Event I set datasource to Javascript variable containing Json data array. Seems to function as expected, until I set height of igGrid to absolute px on initialization. Now grid header is rendered twice. Is's a bug for sure. Occurs only if iggrid colum definitions are specified, grid height is set (grid initialization) and datasource is set in render-Event.

Example (freely adapted from Infragistics example "Grid JSON Binding") http://jsfiddle.net/p86zf5fc/4/

Infragistics IgniteUI 2016.1 (16.1.20161.1009)

Parents
  • 29417
    Offline posted

    Hello Peter,

     Thank you for posting in our forum.

    The issue in this case is that the rendered event will be triggered a second time (since changing the data source requires the grid to re-render and will therefore trigger the event again).

    If you’d like to set a different data source when the grid gets initialized on the client-side I suggest using the dataBinding event where you have direct access to the igDataSource instance (ui.dataSource). You can directly set to it the json data you want to display in the grid, for example:

                dataBinding: function (evt, ui) {

                                    ui.dataSource.settings.dataSource = data;

                    }

     

    You can refer to the following jsfiddle for a full example:

    http://jsfiddle.net/p86zf5fc/5/

     

    Let me know if you have any questions.

     

    Best Regards,

    Maya Kirova

    Infragistics, Inc.

    http://ko.infragistics.com/support

     

     

Reply Children