jsgrid
jsgrid copied to clipboard
Validator callback function get only one value in item array
fields: [
{ name: "id", title: "Id", type: "text", width: 30, editing: false },
{ name: "collection", title: "Коллекция", type: "text", width: 200,
validate: {
message: "Название коллекции не может быть пустым или уже существует", validator:
function(value, item) {
console.log(value, item);
}
}
},
{ name: "link", title: "Ссылка", type: "text", width: 200, editing: false },
{ type: "control" }
]
Output of console.log value: test333 item: {collection: "test333"}
So i can get value, but item array contains only validated field as well. But as i understand it should contain array with all fields of row.
fields: [ { name: "id", title: "Id", type: "text", width: 30, editing: false }, { name: "collection", title: "Коллекция", type: "text", width: 200, validate: { message: "Название коллекции не может быть пустым или уже существует", validator: function(value, item) { console.log(value, item); } } }, { name: "link", title: "Ссылка", type: "text", width: 200, editing: false }, { type: "control" } ]Output of console.log value: test333 item: {collection: "test333"}
So i can get value, but item array contains only validated field as well. But as i understand it should contain array with all fields of row.
It works as per the documented. It returns the item of the row. I am unable to reproduce your problem. will you share your code? so only i can help you and which version of jsGrid do you have using