I've created a grid and customized it very much.
I'm using grouping data by default and have created a very specific group header (see code below).
01.kendoGrid = new kendo.ui.Grid(selector, {02. dataSource: getDataSource(),03. columns: [04. ...05. {06. field: column.field,07. hidden: true,08. aggregates: ['count'],09. groupHeaderTemplate: '#= createGroupRow("' + column.field + '", value) #'10. },11. ...12. ],13. ...14.});And createGroupRow function:
01.function createGroupRow(field, value) {02. ...03. var html = host.document.createElement('div');04. groups[value].gridObject = new kendo.ui.Grid($(html), {05. dataSource: [localData],06. columns: columnService.CreateInnerColumns(),07. scrollable: false08. });09. 10. return $(html).html(); // or html.outerHTML11.}'host' is the current 'window' object.
Rendering is finishing successful and everything seems to be fine... until I try to get this internal grid object.
When I change groups[value].gridObject, nothing happens, absolutely. I try to change to properties, dataSource... rendered grid doesn't want to change. Internally I can see that object actually changed, but nothing happens on the UI.
Also when I try to get object via:
1.$('div').data('kendoGrid')BEFORE rendering (before calling "return $(html).html()") and it works fine, but AFTER that I always get 'undefined' object.
It seems that kendoGrid is creating in the another scope or something like that, and then I cannot get access to that.
I will really appreciate if anyone can help me with that. I just need to create grids in the all group objects and then be able to get this grids and manipulate with it.
Thank you.