I have a grid with most cells bound to model members at the first level. However, my model also contains object members, and I am binding a few columns to members within the object. I am using incell editing, but I obviously want to restrict editing on certain fields.
Here is an small example of my model:
{
Id: 123456,
Name: 'some name',
Cost: 34.56,
Station: {
CallLetters: 'WKGB',
NetworkId: 123
}
}
I am able to bind to the grid without any issue using the following:
schema: {
model: {
fields: {
Id: { type: "number", editable: false },
Name: { type: "string" },
Cost: { type: "number" },
Station: { CallLetters: { type: "string", editable: false }, editable: false }
}
}
}
and:
columns = [
{ title: 'Id', field: 'Id', hidden: true, menu: false },
{ title: 'Station', field: 'Station.CallLetters', width: 80 },
{ title: 'Name', field: 'Name', width: 120 },
{ title: 'Cost', field: 'Cost', width: 95, format: '0:c2' }
]
As you can see, I am setting (and trying to set) certain fields editable: false, and this works just fine for the Id field, and any other field at the top level of my model, but it does not work for the Station.CallLetters field. The Station column is still editable.
Everything else is working fine.
Anyone know what I am doing wrong?
Here is an small example of my model:
{
Id: 123456,
Name: 'some name',
Cost: 34.56,
Station: {
CallLetters: 'WKGB',
NetworkId: 123
}
}
I am able to bind to the grid without any issue using the following:
schema: {
model: {
fields: {
Id: { type: "number", editable: false },
Name: { type: "string" },
Cost: { type: "number" },
Station: { CallLetters: { type: "string", editable: false }, editable: false }
}
}
}
and:
columns = [
{ title: 'Id', field: 'Id', hidden: true, menu: false },
{ title: 'Station', field: 'Station.CallLetters', width: 80 },
{ title: 'Name', field: 'Name', width: 120 },
{ title: 'Cost', field: 'Cost', width: 95, format: '0:c2' }
]
As you can see, I am setting (and trying to set) certain fields editable: false, and this works just fine for the Id field, and any other field at the top level of my model, but it does not work for the Station.CallLetters field. The Station column is still editable.
Everything else is working fine.
Anyone know what I am doing wrong?