ninegrid2 6.1204.0 → 6.1206.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12308,10 +12308,18 @@ class ngCellEx extends HTMLElement
12308
12308
  let fn = this.getAttribute("onbuttonclick") || this.getAttribute("onButtonClick") || this.cell.getAttribute("onbuttonclick") || this.cell.getAttribute("onButtonClick");// || this.getAttribute("@onlinkclick");
12309
12309
  console.log(fn);
12310
12310
  if (fn) {
12311
+
12311
12312
  fn = fn.replace("()","");
12312
12313
 
12313
- if (this.owner[fn]) {
12314
- this.owner[fn].call(this.owner, this.cell.closest("tr").data, parseInt(this.cell.dataset.row), this.cell);
12314
+ const match = fn.match(/^(\w+)\s*\(/);
12315
+
12316
+ // match가 null이면 undefined 반환, 아니면 [1] 반환
12317
+ const methodName = match?.[1];
12318
+
12319
+ console.log(methodName); // "onButtonClick" 또는 undefined
12320
+
12321
+ if (this.owner[methodName]) {
12322
+ this.owner[methodName].call(this.owner, this.cell.closest("tr").data, parseInt(this.cell.dataset.row), this.cell);
12315
12323
  }
12316
12324
  else {
12317
12325
  this.owner.exprFunction(fn).call(this, this.cell.closest("tr").data, parseInt(this.cell.dataset.row));
@@ -12304,10 +12304,18 @@ class ngCellEx extends HTMLElement
12304
12304
  let fn = this.getAttribute("onbuttonclick") || this.getAttribute("onButtonClick") || this.cell.getAttribute("onbuttonclick") || this.cell.getAttribute("onButtonClick");// || this.getAttribute("@onlinkclick");
12305
12305
  console.log(fn);
12306
12306
  if (fn) {
12307
+
12307
12308
  fn = fn.replace("()","");
12308
12309
 
12309
- if (this.owner[fn]) {
12310
- this.owner[fn].call(this.owner, this.cell.closest("tr").data, parseInt(this.cell.dataset.row), this.cell);
12310
+ const match = fn.match(/^(\w+)\s*\(/);
12311
+
12312
+ // match가 null이면 undefined 반환, 아니면 [1] 반환
12313
+ const methodName = match?.[1];
12314
+
12315
+ console.log(methodName); // "onButtonClick" 또는 undefined
12316
+
12317
+ if (this.owner[methodName]) {
12318
+ this.owner[methodName].call(this.owner, this.cell.closest("tr").data, parseInt(this.cell.dataset.row), this.cell);
12311
12319
  }
12312
12320
  else {
12313
12321
  this.owner.exprFunction(fn).call(this, this.cell.closest("tr").data, parseInt(this.cell.dataset.row));
@@ -191,10 +191,18 @@ export class ngCellEx extends HTMLElement
191
191
  let fn = this.getAttribute("onbuttonclick") || this.getAttribute("onButtonClick") || this.cell.getAttribute("onbuttonclick") || this.cell.getAttribute("onButtonClick");// || this.getAttribute("@onlinkclick");
192
192
  console.log(fn);
193
193
  if (fn) {
194
+
194
195
  fn = fn.replace("()","");
195
196
 
196
- if (this.owner[fn]) {
197
- this.owner[fn].call(this.owner, this.cell.closest("tr").data, parseInt(this.cell.dataset.row), this.cell);
197
+ const match = fn.match(/^(\w+)\s*\(/);
198
+
199
+ // match가 null이면 undefined 반환, 아니면 [1] 반환
200
+ const methodName = match?.[1];
201
+
202
+ console.log(methodName); // "onButtonClick" 또는 undefined
203
+
204
+ if (this.owner[methodName]) {
205
+ this.owner[methodName].call(this.owner, this.cell.closest("tr").data, parseInt(this.cell.dataset.row), this.cell);
198
206
  }
199
207
  else {
200
208
  this.owner.exprFunction(fn).call(this, this.cell.closest("tr").data, parseInt(this.cell.dataset.row));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ninegrid2",
3
3
  "type": "module",
4
- "version": "6.1204.0",
4
+ "version": "6.1206.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -191,10 +191,18 @@ export class ngCellEx extends HTMLElement
191
191
  let fn = this.getAttribute("onbuttonclick") || this.getAttribute("onButtonClick") || this.cell.getAttribute("onbuttonclick") || this.cell.getAttribute("onButtonClick");// || this.getAttribute("@onlinkclick");
192
192
  console.log(fn);
193
193
  if (fn) {
194
+
194
195
  fn = fn.replace("()","");
195
196
 
196
- if (this.owner[fn]) {
197
- this.owner[fn].call(this.owner, this.cell.closest("tr").data, parseInt(this.cell.dataset.row), this.cell);
197
+ const match = fn.match(/^(\w+)\s*\(/);
198
+
199
+ // match가 null이면 undefined 반환, 아니면 [1] 반환
200
+ const methodName = match?.[1];
201
+
202
+ console.log(methodName); // "onButtonClick" 또는 undefined
203
+
204
+ if (this.owner[methodName]) {
205
+ this.owner[methodName].call(this.owner, this.cell.closest("tr").data, parseInt(this.cell.dataset.row), this.cell);
198
206
  }
199
207
  else {
200
208
  this.owner.exprFunction(fn).call(this, this.cell.closest("tr").data, parseInt(this.cell.dataset.row));