Hello
In PUT and POST operation all number properties of my entity are sent in string format. In my GET operation, I receive my entity with correct value, but when I send my entity, my datasource convert number properties in string.
My datasource definition :
var
_FrmTest_dtTtOrigineGeographique =
new
kendo.data.DataSource({
type:
"odata-v4"
,
content:
"json"
,
transport: {
read: {
url:
"https://localhost:9443/odata/EntiteTtOrigineGeographiques"
,
},
update: {
url:
function
(data) {
return
"https://localhost:9443/odata/EntiteTtOrigineGeographiques("
+ data.IdTtOrigineGeographique +
")"
},
}
},
schema: {
model: {
id:
"IdTtOrigineGeographique"
,
fields: {
IdTtOrigineGeographique: {
type:
"number"
,
editable:
false
,
},
StrLibelle: {
type:
"string"
},
Pourcentage: {
type: "number"
}
}
}
},
error:
function
(e) {
console.log(e.xhr);
},
filter: {
logic:
"and"
,
filters: [
{ field:
"IdTtOrigineGeographique"
, operator:
"eq"
, value: _idTtOrigineGeographiqueSelect }]
},
serverFiltering:
true
,
serverSorting:
true
});
With GET operation, I receive my entity like this
{
"@odata.context"
:
"https://localhost:9443/odata/$metadata#EntiteTtOrigineGeographiques"
,
"@odata.count"
:1,
"value"
:[{
"IdTtOrigineGeographique"
:5,
"StrLibelle"
:
"Autres départements", "Pourcentage": 4.55
}]}
But when I update my entity and I call sync method, my datasource send my entity like this :
{
"IdTtOrigineGeographique"
:
"5"
,
"StrLibelle"
:
"Autres département","Pourcentage":"4.55"
}
I verify JSON.stringify() and kendo.stringify() functions and my entity is correctly serialize
For integer property it's not blocking because my webservice convert automatically string to integer. But with float (ex : 4.55), I have a exception and my entity it's not deserialize.
Can you help me ? Thanks in advance
Arnaud