There seems to be some issue with using knockout with the data and columns.....
I have an object in my viewmodel...
self.ejKanban_options = {
dataSource: self.tasks,
columns: self.columns,
fields: {
content: "Subject",
primaryKey: "TaskId"
},
keyField: "BoardColumnId"
};
and I add columns and tasks using an Ajax.Get...
function fillBoard (board){
var a = [];
var kb = $('.kanbanboard').data('ejKanban');
//Set the columns observable array
$.each(board.Board.Columns, function (i, column) {
a.push({ headerText: column.Name, key: column.BoardColumnId });
});
self.columns(a);
//Set the Task Data
var kb = $('.kanbanboard').data('ejKanban');
var dataManager = new ej.DataManager(board.Tasks);
self.tasks(dataManager);
}
Now this will in fact show the columns as it should, however the tasks are not showing up in the columns, but they are in the internal array of the ejKanban board.
Now after much testing, I find that if I set the columns observable with some data first
self.columns = ko.observableArray([{ headerText: "test", key: "45064E8E-6F88-459D-BA74-B8721F1E15C8" }, { headerText: 'Planned', key: 'EBED51D0-FA68-49C6-830D-EE72B30E7BA0' }]);
the task data is populated into the two columns I have pre added to the board before my ajax event, these two columns are in fact removed and new columns are added, but the two columns with the keys that were set in the initialization of the kanban control work, however the other columns with new keys do not work. As its if there is an internal array of ids being used to filter the tasks that isn't being refreshed when the columns are updated?
I could not get the