This is a datatable and I am editing the values, title in this case. If you don’t click out of a field and just click on the save button then the object (row) doesn’t pick up the value that you just typed into the data form. Here is my code.
webix.ready(function () {
cust = webix.ui({
container: "customers",
responsive: true,
id: "custdata",
view: "datatable",
columns: [
{
id: "", template: "<input class='viewbtn' type='button' value='View'>",
css: "padding_less",
width: 60
},
{id: "id", header: "ID", width: 70},
{id: "display_name", header: ["Name", {content: "textFilter"}], width: 150},
{id: "title", header: "Title", editor: "text", width: 150},
{id: "company", header: ["Company", {content: "textFilter"}], editor: "text", width: 200},
{id: "email", header: "Email", width: 250},
{
id: "sales_contact", header: ["Sales Contact", {content: "textFilter"}],
editor: "richselect", options: ["none", "mike"], width: 150
},
{id: "contact_date", header: "Contact date", editor: "text", width: 120},
{
id: "", template: "<input class='savebtn' type='button' value='Save'>",
css: "padding_less",
width: 100
},
],
editable: true,
resizeColumn: true,
autoheight: true,
autowidth: true,
pager: {
container: "paging_here",
size: 10,
group: 5
},
on: {
"onItemClick": function (id) {
}
},
url: "data/getcustomers"
});
// save record
cust.on_click.savebtn = function (e, id, trg) {
webix.message("Save row: " + id.row);
var record = cust.getItem(id.row);
console.log(record, record.title);
saveCust(record);
return false;
};