New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #209 #213

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@rpallas

rpallas commented Mar 4, 2013

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

Prevents duplication of the selection column.
Added a check to make sure the selection column doesn't exist before adding it.
@dotNetFollower

This comment has been minimized.

Show comment
Hide comment
@dotNetFollower

dotNetFollower Jan 24, 2017

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 commented Jan 24, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment