Knockout-Contrib / Knockout-Contrib/KoGrid

columnsChanged to notify a single column

Open
#181 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
277
Forks
124
PR merge metrics
No merged PRs in 30d

Description

Hi,
Thanks again for suppoting and enhancing koGrid.
There is one suggestion i want to make.

I have to persist any column setup changes that are made from inside the grid.
But each time a change was made to a column, you're passing the whole list of koGrid columns in columnsChanged event, so I need to store the original list and compare with the columns passed to event.

I think It would make more sense to change the event to be passing just one changed column, as the passed list of columns always has just a single change.
And some arguments that would tell the change type (i.e. width, sorting or disable).
And if it was sorting (drag and drop), then add old or at least NEW position of the column.

Should not be a hard change, as you already have this data on the hands (like col.Index and headerScope.Index in self.onHeaderDrop event), you just need to call the event from the places where you're actually changing the column instead of subscribing to cols collection changes.
And width and disabling events are fired from inside the kg.Column, so you have the column in there too.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the columnsChanged event and the cols collection changes described in the issue. Review self.onHeaderDrop for column position data and kg.Column for width and disabling events. Done means the event reports one changed column with its change type and, for sorting, the new position, with coverage for each change path.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.