ここでは、グリッドにいくつかの列があり、「receivedquantity」フィールドにデフォルト値を指定したいと考えています。デフォルトでは、フィールドに入力された受信数量は「Quantity」フィールドと等しくなります。ユーザーがフィールドを編集すると、データはデータベースから取得されます.ここでは mvc パターンを使用しています...
this.columns=
[
{
header:'name',
dataIndex:'name'},
{
header:'Quantity',
dataIndex:'quantity',
},
{
header:'Received Quantity',
dataIndex:'receivedquantity',
selectOnFocus: true,
filterable:true,
renderer:function(val, meta, record){
var receivedquantity = record.data.receivedquantity;
var quantity=record.data.quantity;
if(receivedquantity==0)//by default receivedquantity=0
{
//set (receivequantity=quantity) in the grid's received quantity cell
}},
editor: {allowBlank:false
}
}
];