<sc-grid-fields>
<sc-grid-field data-field="old" data-type="object"></sc-grid-field>
</sc-grid-fields>
</sc-grid>
.........
onResponse : function(event)
{
var me = this;
var _result = event.target.lastResponse;
switch (event.target.id)
{
case "selNP" :
me.$.gridPanelNPHD.setDataProvider([_result.npHD]);
_result.npDT.forEach(function(data, index, array)
{
data.old = UT.copy(data);
});
me.set("npHD", _result.npHD);
me.set("npDT", _result.npDT);
me.applyFormula();
break;
.........
setColumnNPDT : function()
{
var me = this;
var _gridNPDT = me.$.gridPanelNPDT;
var _providerNPDT = _gridNPDT.getDataProvider();
_providerNPDT.setItemAtBatch(true, function(_index, _data)
{
return { npd_prod_cd : me.onItemEditable(_data, {dataField:"npd_prod_cd"}) ? _data.old.npd_prod_cd : null
, npd_item_cd : me.onItemEditable(_data, {dataField:"npd_item_cd"}) ? _data.old.npd_item_cd : null
, npd_gds_nm_ko : me.onItemEditable(_data, {dataField:"npd_gds_nm_ko"}) ? _data.old.npd_gds_nm_ko : null
, npd_np_nm : me.onItemEditable(_data, {dataField:"npd_np_nm"}) ? _data.old.npd_np_nm : null
, npd_color_chip : me.onItemEditable(_data, {dataField:"npd_color_chip"}) ? _data.old.npd_color_chip : null
, npd_sal_vd_nm : me.onItemEditable(_data, {dataField:"npd_sal_vd_nm"}) ? _data.old.npd_sal_vd_nm : null
, npd_aft_open_mm : me.onItemEditable(_data, {dataField:"npd_aft_open_mm"}) ? _data.old.npd_aft_open_mm : null
, npd_bar_cd : me.onItemEditable(_data, {dataField:"npd_bar_cd"}) ? _data.old.npd_bar_cd : null
, npd_orgn : me.onItemEditable(_data, {dataField:"npd_orgn"}) ? _data.old.npd_orgn : null
, npd_nfs_cd : me.onItemEditable(_data, {dataField:"npd_nfs_cd"}) ? _data.old.npd_nfs_cd : null
, npd_nfs_etc : me.onItemEditable(_data, {dataField:"npd_nfs_etc"}) ? _data.old.npd_nfs_etc : null
, npd_add_rem : me.onItemEditable(_data, {dataField:"npd_add_rem"}) ? _data.old.npd_add_rem : null
, npd_rqst_rem : me.onItemEditable(_data, {dataField:"npd_rqst_rem"}) ? _data.old.npd_rqst_rem : null
};
});
_gridNPDT.refresh();
},
---------------------------------------------
sc-grpi-field에 object형으로 선언해줘야 한다.
setItemAtBatch로 return {old:UT.copy(_data)}로 만들어도 역시 선언이 필요하다.