grid-override.html 에 아래 코드 추가
<script>
SCGrid.prototype.$$defaultAttachmentPopup = SCGrid.prototype.defaultAttachmentPopup;
SCGrid.prototype.defaultAttachmentPopup = function(data, item, provider)
{
var me = this,
grpCd = item.grpCd,
itemIndex = item.rowIndex,
fieldName = item.dataField,
editable = item.editable,
sharedGroupFieldName = me.getColumnElByName(fieldName).sharedGroupField;
_openAttachPopup = function(attachPopup)
{
var content = attachPopup.getWindowContent();
content.__provider = provider;
content.__grid = me;
content.setParam({
grpCd : grpCd,
itemIndex : itemIndex,
fieldName : fieldName
});
content.setUploadOptions({
editable : editable
});
content.addEventListener("close", function(e){
attachPopup.close();
});
content.addEventListener("saved-attach", function(e){
var fileCount = e.detail.file_count,
itemIndex = e.detail.itemIndex,
fieldName = e.detail.fieldName,
grpCd = e.detail.grpCd,
data = {
fileCount : fileCount, itemIndex : itemIndex, fieldName : fieldName, grpCd : grpCd
}
this.__provider.setCellValue(itemIndex, fieldName, fileCount);
this.__provider.setCellValue(itemIndex, sharedGroupFieldName, grpCd);
this.__grid.fire("upload-complete",data, {bubbles: false});
attachPopup.close();
});
attachPopup.show();
}
var attachPopup = SCPopupManager.get('cc-attachment-popup');
if (attachPopup)
{
_openAttachPopup(attachPopup);
}
else
{
me.domHost.importLink('ui/lib/custom/html/cc-attachment-popup.html', function (moduleId)
{
SCPopupManager.register("cc-attachment-popup", "cc-attachment-popup", 800, 340, {
modal: true,
maximizable: true
});
attachPopup = SCPopupManager.get('cc-attachment-popup');
_openAttachPopup(attachPopup);
});
}
}
</script>