I have a editable grid (inline) that contains a currency field, in pt-BR culture.
When I'm adding a new row, if I put the value 0,23 for example, and click Update, the grid now shows the value R$ 23,00.
How can I correct that bug? I've already checked if the culture script is set properly...
Here is my code (AdditionalPrice is the field)
var dataSource = new kendo.data.DataSource({
transport: {
read: "/Product/OptionGridRead",
update: {
url: "/Product/OptionGridUpdate",
type: "POST"
},
destroy: {
url: "/Product/OptionGridDestroy",
type: "POST"
},
create: {
url: "/Product/OptionGridCreate",
type: "POST"
}
},
schema: {
model: {
id: "Id",
fields: {
Name: { validation: { required: true } },
AdditionalPrice: { type: "number", validation: { required: true } },
IsDefault: { type: "boolean" }
}
}
}
});
$("#grid").kendoGrid({
height: 190,
width: 200,
dataSource: dataSource,
toolbar: ["create"],
columns: [
{ field: "Name", title: "Nome", editable: true },
{ field: "AdditionalPrice", title: "Valor Adicional", format: "{0:c2}", width: "150px" },
{ field: "IsDefault", title: "PadrĂ£o", width: "100px", template: '<input type="checkbox" name="IsDefault_#= id #" value="#= id #" id="IsDefault_#= id #" disabled="disabled" ${IsDefault==true?"checked":""} />'},
{ command: ["edit", "destroy"], title: " ", width: "210px" }],
editable: {
mode: "inline",
createAt: "bottom"
},
});
When I'm adding a new row, if I put the value 0,23 for example, and click Update, the grid now shows the value R$ 23,00.
How can I correct that bug? I've already checked if the culture script is set properly...
Here is my code (AdditionalPrice is the field)
var dataSource = new kendo.data.DataSource({
transport: {
read: "/Product/OptionGridRead",
update: {
url: "/Product/OptionGridUpdate",
type: "POST"
},
destroy: {
url: "/Product/OptionGridDestroy",
type: "POST"
},
create: {
url: "/Product/OptionGridCreate",
type: "POST"
}
},
schema: {
model: {
id: "Id",
fields: {
Name: { validation: { required: true } },
AdditionalPrice: { type: "number", validation: { required: true } },
IsDefault: { type: "boolean" }
}
}
}
});
$("#grid").kendoGrid({
height: 190,
width: 200,
dataSource: dataSource,
toolbar: ["create"],
columns: [
{ field: "Name", title: "Nome", editable: true },
{ field: "AdditionalPrice", title: "Valor Adicional", format: "{0:c2}", width: "150px" },
{ field: "IsDefault", title: "PadrĂ£o", width: "100px", template: '<input type="checkbox" name="IsDefault_#= id #" value="#= id #" id="IsDefault_#= id #" disabled="disabled" ${IsDefault==true?"checked":""} />'},
{ command: ["edit", "destroy"], title: " ", width: "210px" }],
editable: {
mode: "inline",
createAt: "bottom"
},
});