KoGrid icon indicating copy to clipboard operation
KoGrid copied to clipboard

Fix for issue #209

Open rpallas opened this issue 12 years ago • 1 comments

Added a check to make sure the selection column doesn't exist before adding it.

rpallas avatar Mar 04 '13 16:03 rpallas

It seems to be never applied to the main branch since the project looks abandoned. I however still try to avoid 3rd party source code changing, so here is an alternative solution wrapped into custom binding:

ko.bindingHandlers["koGridFixed"] = {
   init: function (element, valueAccessor, allBindingsAccessor, data, context) {
      var gridOptions = ko.utils.unwrapObservable(valueAccessor());
      if (gridOptions && gridOptions.columnDefs) {
         var columnDefsArr = ko.utils.unwrapObservable(gridOptions.columnDefs);
         if (columnDefsArr && columnDefsArr.length > 0 && columnDefsArr[0].field === '\u2714')
            columnDefsArr.splice(0, 1);
      }
 
      return ko.bindingHandlers["koGrid"].init(element, valueAccessor, allBindingsAccessor, data, context);
   }
};

The koGrid binding should be replaced with koGridFixed across the views. Some additional details are here - koGrid: Bug – Checkboxes column duplication

dotNetFollower avatar Jan 24 '17 18:01 dotNetFollower