My column templates disappear upon re-binding the grid. I have successfully reset the templates using the setColumnTemplate method. However, I must do this after all igGrid events have fired and it causes unnecessary rendering. I'm currently doing this on a delay just for testing. If I try calling this method inside the dataBound or dataRendered, it results in infinite recursion. I can stop the recursion by setting render = false; However, then it sets the template but doesn't render the display. What is the proper way to preserve column templates when re-binding the grid?
Thanks
John
Turns out it was an AngularJS issue. I needed to bind igGrid outside the angular digest. Wrapping my binding in a timeout worked. It is interesting that everything about the binding worked, except for the column template.
$timeout(function () { $("#grid").igGrid("dataSourceObject", adventureWorksNewInstance); $("#grid").igGrid("dataBind"); }, 1);
My apologies for the delay; I've been on vacation. Your example does not re-bind the data source. You are simply calling a method on the data source, then committing. However, I have modified your example to perform a data bind on a new data source instance and it did retain the template. My problem must be some kind of interaction with AngularJS.
Thank you for your effort.
BTW, below is what I was looking for in the example:
var adventureWorksNewInstance = [{ProductID:0,Name:"adsf",ProductNumber:"123",MakeFlag:true }];
$("#grid").igGrid("dataSourceObject",adventureWorksNewInstance);$("#grid").igGrid("dataBind");
Hello John,
I made a sample in order to test the behavior that you're experiencing, however I was unable to reproduce your issue. The column template does not disappear upon re-binding the grid. I'm attaching a sample for your reference which you may modify and try reproducing the issue on it. If you have any further questions, please let me know.
Regards,
Tsanna