Knockout-Contrib / Knockout-Contrib/KoGrid

kogrid not updating column when data changed

Open
#313 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

i have simple data like this :

```
var dataFromAjax = [
{Id : 1, Name : "Yoza", Status : 1},
{Id : 2, Name : "Dhika", Status : 1}
];
```

and next data from ajax will have different schema. like this :

```
var nextData = [
{Id : 1, Name : 'Yoza', Job : 'Programmer', Phone : '08788'},
{Id : 1, Name : 'Dhika', Job : 'Designer', Phone : '99987922'}
]
```

in my piece of code :

```
self.Data = ko.observableArray();
self.Data(nextData);
self.Data.valueHasMutated();
```

the problem is column not updated. column still same like first schema, that are id, name and status. Job and Phone not rendered. how to render different schema?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how KoGrid derives its columns from self.Data and how observableArray updates are handled; the issue provides no repository file or test entry point. Reproduce the transition from dataFromAjax to nextData and determine whether changing the schema is supported. Done means the Job and Phone columns render after the data replacement, with the earlier columns handled consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.